Skip to content

Hex to Decimal Converter - Hexadecimal to Number

Decimal (10)
—
Other bases
Binary (2)—
Octal (8)—
Hexadecimal (16)—
Base 36—

Convert Hexadecimal Numbers to Decimal

Paste a hex value such as 0x1A3F, ff or a grouped value like DEAD BEEF, and the decimal result appears as you type, with binary and octal underneath. The conversion is exact for any length, so 64-bit IDs, memory addresses and hash prefixes are safe to convert.

How to Convert Hex to Decimal by Hand

Hexadecimal is base 16. Each position is worth 16 times the position to its right: 1, 16, 256, 4096, 65536 and so on. Replace any letter with its value (A=10 to F=15), multiply each digit by its place value, and add.

Worked example: 0x2F3A

  1. 2 is in the 4096s place: 2 × 4096 = 8192.
  2. F (15) is in the 256s place: 15 × 256 = 3840.
  3. 3 is in the 16s place: 3 × 16 = 48.
  4. A (10) is in the 1s place: 10 × 1 = 10.
  5. Add them: 8192 + 3840 + 48 + 10 = 12090.

For long values, the running-total method is quicker: start at 0, and for each digit multiply the total by 16 and add the digit. For 2F3A: 2, 47, 755, 12090.

Hex Digit Values

HexDecimalBinary
000000
110001
220010
330011
440100
550101
660110
770111
881000
991001
A101010
B111011
C121100
D131101
E141110
F151111

Common Hex Values

HexDecimal
0x7F127
0x80128
0xFF255
0x100256
0x3E81,000
0x4001,024
0x7FFF32,767
0xFFFF65,535
0x1000065,536
0xFFFFFF16,777,215
0x7FFFFFFF2,147,483,647
0xFFFFFFFF4,294,967,295

Hex Notations You Will See

The same hex number is written differently depending on where it appears. Programming languages use a 0x prefix (0x1F). CSS colours use # (#1F1F1F). HTML character references use , Unicode uses U+1F600, assembly listings may add an h suffix (1Fh), and strings in C or Python use \x1F for single bytes. In every case the digits after the marker are ordinary base-16. The converter strips a leading 0x for you; remove any other marker, such as # or a trailing h, before pasting.

Where Hex Numbers Come From

Hex is used wherever bytes are written out: colour codes, memory addresses in stack traces, error codes such as Windows 0x80070005, Unicode code points (U+00E9) and file signatures. For the reverse direction, use the decimal to hex converter. If your hex represents text rather than a number, try hex to text instead.

Related Tools

Frequently Asked Questions

How do you convert hex to decimal?
Multiply each hex digit by 16 raised to its position (counting from 0 on the right) and add the results. Letters stand for 10 to 15: A=10, B=11, C=12, D=13, E=14, F=15. For example, 1F = 1 x 16 + 15 = 31.
What is 0xFF in decimal?
0xFF is 255. It is the largest value that fits in one byte, which is why it appears in colour codes, masks and byte ranges. 0xFFFF is 65535 and 0xFFFFFFFF is 4294967295.
Does the converter handle 64-bit hex values?
Yes. It uses arbitrary-precision integers, so 0xFFFFFFFFFFFFFFFF converts exactly to 18446744073709551615. Excel's HEX2DEC only accepts up to 10 hex digits, and JavaScript's parseInt rounds anything above 2^53, so 0xFFFFFFFFFFFFFFFF comes back as 18446744073709552000.
How do I convert a hex colour like #1E90FF to RGB?
Split it into three pairs and convert each pair separately: 1E = 30, 90 = 144, FF = 255, so #1E90FF is rgb(30, 144, 255). Paste each pair into the converter. Leave out the #, which the converter does not accept; 1E90FF on its own converts to 2003199, the colour as a single 24-bit number.
Is hex input case-sensitive?
No. 'ff', 'FF' and '0xFf' all give 255. Spaces, underscores and commas are ignored, so you can paste grouped values such as 'DEAD BEEF'.