How to use the hex to decimal converter
- Type or paste a hex number into the input box. Prefixes such as
0xor#, a trailingh, spaces and underscores are all accepted. Enter one number per line to convert a list. - The decimal value appears instantly, together with the binary and octal values and a step-by-step explanation of the calculation.
- If the hex value is a signed integer, tick Signed (two's complement) and pick the bit width – for example
FFis −1 as an 8-bit number. Then copy the result.
How to convert hex to decimal
Hexadecimal is a base-16 number system. It uses the digits 0–9 and the letters A = 10, B = 11, C = 12, D = 13, E = 14 and F = 15. Each position is worth 16 times more than the one to its right, so the hex to decimal conversion formula is:
decimal = dₙ × 16ⁿ + … + d₂ × 16² + d₁ × 16¹ + d₀ × 16⁰
Multiply every digit by the power of 16 for its position, counting from 0 on the right, and add the results. Example: 3C = 3 × 16 + 12 = 60, and 1A3F = 1 × 4096 + 10 × 256 + 3 × 16 + 15 × 1 = 4096 + 2560 + 48 + 15 = 6719.
| Position | Power of 16 | Decimal value |
|---|---|---|
| 0 | 16⁰ | 1 |
| 1 | 16¹ | 16 |
| 2 | 16² | 256 |
| 3 | 16³ | 4096 |
| 4 | 16⁴ | 65536 |
| 5 | 16⁵ | 1048576 |
Hex to decimal table
The hex values people look up most often, with their decimal equivalents. One byte ranges from 00 to FF (0–255); the notes show the ASCII character or what the value means in programming.
| Hex | Decimal | Good to know |
|---|---|---|
10 | 16 | 16¹ |
1A | 26 | 1 × 16 + 10 |
20 | 32 | ASCII space |
2A | 42 | ASCII * |
3C | 60 | ASCII < |
64 | 100 | ASCII d |
7F | 127 | Largest signed 8-bit value |
80 | 128 | −128 as a signed byte |
FF | 255 | Largest byte value; −1 as a signed byte |
100 | 256 | 16² |
3E8 | 1000 | 3 × 256 + 14 × 16 + 8 |
7FFF | 32767 | Largest signed 16-bit value |
FFFF | 65535 | Largest 16-bit value; −1 as a signed 16-bit number |
7FFFFFFF | 2147483647 | Largest signed 32-bit integer |
FFFFFFFF | 4294967295 | Largest unsigned 32-bit integer |
Hex to decimal in Python, JavaScript and Excel
- Python:
int('1A', 16)returns 26; the0xprefix is allowed too:int('0xff', 16)= 255. - JavaScript:
parseInt('1A', 16)orNumber('0x1A'). For values above 2⁵³ useBigInt('0x' + hex)to avoid rounding. - Excel and Google Sheets:
=HEX2DEC("1A"). Excel reads 10-digit values as signed 40-bit numbers, so=HEX2DEC("FFFFFFFFFF")returns −1. - Java, C# and C:
Integer.parseInt("1A", 16),Convert.ToInt32("1A", 16)andstrtol("1A", NULL, 16). - Linux and macOS shell:
echo $((16#1A))orprintf '%d\n' 0x1A.
Why use Online Hex Converter?
- FreeEvery tool is free with no limits, accounts or watermarks.
- PrivateProcessing happens locally in your browser. Files are never uploaded.
- FastLightweight pages that load instantly on any device.
- Works everywhereUse it on Windows, macOS, Linux, Android and iPhone.
Frequently asked questions
What is FF in decimal?
FF in hex is 255 in decimal: 15 × 16 + 15 = 255. It is the largest value one byte can hold. Read as a signed 8-bit number (two's complement), the same bits mean −1.
How do I convert a negative hex number to decimal?
If the hex number has a minus sign, convert the digits and keep the sign: −1A = −26. If it is a two's-complement value such as FFFE, tick Signed (two's complement) and choose 16-bit: the converter subtracts 2¹⁶ = 65536 from 65534 and shows −2.
Can I convert hex numbers with a fractional part?
Yes. Digits after the point are worth 16⁻¹ = 1/16, 16⁻² = 1/256 and so on, so 1A.8 = 26 + 8/16 = 26.5 and 0.4 = 0.25.
Is there a limit on the size of the hex number?
No practical limit. The converter uses arbitrary-precision integers, so 64-bit values such as FFFFFFFFFFFFFFFF (18446744073709551615) and even longer hex strings are converted exactly, without rounding.