Hex Converter: Hexadecimal to Decimal and Decimal to Hex

  • Free
  • No sign-up
  • Runs in your browser
  • Version 1.0.2
  • Last updated 2026-11-02
Report a problem

Type a hexadecimal number such as FF or 0x1A3F and see it in decimal, binary and octal. To go from decimal to hex, leave the base on Decimal (10) and type the number: the hex row is shown first.

Everything you enter is processed in your browser and is never sent to a server.

How to use

  1. For hex to decimal, choose Hexadecimal (16) as the base of the number you type, then type it with or without the 0x prefix.
  2. For decimal to hex, leave the base on Decimal (10) and type the number. The hexadecimal row is first.
  3. Press Copy on any row. The page also shows how many bits the number needs.

Examples

255 (decimal)
→ ff in hexadecimal
15 × 16 + 15 = 255.
0xFF (hex)
→ 255 in decimal, 11111111 in binary
The 0x prefix is accepted.
DEADBEEF (hex)
→ 3735928559 in decimal
A 32-bit value: 8 hex digits are 32 bits.
0x1A3F (hex)
→ 6719 in decimal
1 × 4096 + 10 × 256 + 3 × 16 + 15.
7FFFFFFF (hex)
→ 2147483647 in decimal
The largest signed 32-bit integer. 80000000 is 2147483648.
FF8800 (hex)
→ 16746496 in decimal
A colour as one number. Its three bytes FF, 88 and 00 are 255, 136 and 0.
#FF8800 (hex)
→ Error: "#" is not a valid digit in base 16.
The # of a colour code is not part of the number. Leave it out.

How it works

This page is the number base converter with the hexadecimal row first. The conversion uses whole-number arithmetic of unlimited size, so long values such as hashes and keys are converted exactly. A digit that does not belong to the base, such as a G in hex, is pointed out instead of guessed.

Why programmers like hex

Sixteen is 2 to the power 4, so one hex digit covers exactly four bits and two digits cover exactly one byte. A byte is 11111111 in binary and ff in hex, which is why memory dumps, colour codes, hashes and network addresses are written in hex. The same number takes the most characters in binary, fewer in decimal and the fewest in hex.

Sizes to remember

Hex Decimal Bits
ff 255 8
fff 4095 12
ffff 65535 16
7fffffff 2147483647 31
ffffffff 4294967295 32

Eight hex digits are one 32-bit word, and the signed 32-bit maximum is 7fffffff because the top bit is kept for the sign.

What the page does not do

Fractions are not converted, only whole numbers, and a number does not have to fit any size: values wider than 32 or 64 bits are converted as they are. Text is not converted either. To see the hex of the letters in a word, you would need an encoding step first, and this page works on numbers.

Sources

Frequently asked questions

What is hexadecimal?
A base-16 system that uses the digits 0 to 9 and the letters A to F, where A is 10 and F is 15. One hex digit stands for exactly four bits, so programmers use it to write binary values in a short form.
How do I convert hex to decimal by hand?
Multiply each digit by a power of 16, from the right, and add them. For 1A3: 1 × 256 + 10 × 16 + 3 = 419.
How do I convert decimal to hex by hand?
Divide by 16 again and again and write down the remainders, then read them from last to first, using A to F for 10 to 15. For 255: 255 ÷ 16 = 15 r 15, and 15 ÷ 16 = 0 r 15, so the digits are F and F: ff.
Does the case of the letters matter?
No. ff, FF and Ff are the same number. The results are shown in lowercase.
Is this the page for color codes?
A color such as #FF8800 is three hex numbers (FF, 88, 00), one for red, green and blue: 255, 136 and 0. For colors, the color converter does the whole job.
Why did my 0b1010 turn into a huge number?
A prefix is only recognised when it matches the base you chose. In base 16, 0b1010 is not binary but the six hex digits 0, b, 1, 0, 1, 0, which is 725008. Set the base to Binary (2) for a 0b number.
How many hex digits does a hash or an ID have?
Four bits per digit. A SHA-256 hash is 256 bits, so 64 hex digits, and a UUID is 128 bits, so 32 hex digits. Pasting one in shows the bit count.
What are the hex digits of a negative number?
The page writes a minus sign in front, so -10 is -a. It does not show two's complement, the form a computer stores, because that depends on a chosen width such as 8 or 32 bits.
Is anything sent to a server?
No. The conversion happens in your browser.
Version history
  • 1.0.2 — Adds why programmers use hex, a table of sizes to remember, how a prefix that does not match the base is read, hash and ID lengths, and what the page does not do, with more examples and questions.
  • 1.0.1 — Clarifies the search title with the tool's main task and whether it is free or runs online.
  • 1.0.0 — First release.

Last updated: