About the Hex to Decimal
Paste a hexadecimal number and this hex to decimal converter shows its base-10 value instantly. Base 16 turns up in plenty of places where you'd rather see an ordinary number: an error code like 0x80070005, a memory address in a crash log, a byte in a packet capture, or a colour value.
Upper or lower case letters both work, and so does a 0x prefix. Every digit is checked, so a typo such as the letter O instead of zero is reported rather than silently producing a wrong number.
How it works
Each hex digit is worth sixteen times the digit to its right. The rightmost digit counts units, the next counts 16s, then 256s, 4096s and 65536s. Letters stand for the values ten to fifteen: A = 10, B = 11, C = 12, D = 13, E = 14, F = 15.
The tool reads the digits left to right, multiplying the running total by 16 and adding each new digit. It works on exact big integers, so a 32-digit value like FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF (the largest 128-bit number) gives 340282366920938463463374607431768211455 with no rounding at the end.
decimal = hₙ×16ⁿ + … + h₂×16² + h₁×16¹ + h₀×16⁰ h = digit value (0–9, A=10 … F=15), h₀ is the rightmost digit running form: total = total × 16 + next digit
Assumptions and limits
- A # in front, as in #1E90FF, is not accepted; delete it and paste the six digits. The 0x prefix is fine.
- The digits are read as one unsigned value. FFFFFFFF gives 4294967295, not −1, even though a 32-bit signed integer stores −1 that way.
- Single spaces or underscores between groups are ignored, so DEAD_BEEF and DEAD BEEF both give 3735928559.
- Because E is a hex digit, 1e3 is read as the hex number 1E3, which is 483. It is not treated as scientific notation.
- Hex fractions (with a point) aren't converted, and the longest accepted input is 4,096 hex digits.
Worked examples
Hex 2A3F to decimal, digit by digit
Write the place values 4096, 256, 16 and 1 under the four digits, multiply, and add.
2 × 4096 = 8192 A (10) × 256 = 2560 3 × 16 = 48 F (15) × 1 = 15 total = 10815
The largest signed 32-bit integer
0x7FFFFFFF appears in many codebases as a maximum. Pasting it with the prefix gives 2147483647. One more, 0x80000000, is 2147483648, the point where a signed 32-bit value would overflow.
An IPv4 address stored as hex
Some logs and databases store an address as eight hex digits. AC100A05 converts to 2886732293 as a single number. Converted in pairs instead, AC, 10, 0A and 05 give 172, 16, 10 and 5, the address 172.16.10.5.
Hex to decimal lookup table
Hex shown without the 0x prefix; letters may be typed in either case. Read right to left to turn a decimal value back into hex.
| Hex | Decimal | Context |
|---|---|---|
| A | 10 | |
| F | 15 | |
| 1F | 31 | |
| 64 | 100 | looks like 64, means 100 |
| 7F | 127 | DEL in ASCII |
| 80 | 128 | top bit of a byte |
| C8 | 200 | |
| FF | 255 | full byte |
| 100 | 256 | |
| 3E8 | 1000 | |
| 400 | 1024 | |
| 7FF | 2047 | |
| CAFE | 51966 | |
| DEAD | 57005 | |
| FFFF | 65535 | largest 16-bit value |
| 10000 | 65536 | |
| 7FFFFFFF | 2147483647 | signed 32-bit max |
| FFFFFFFF | 4294967295 | unsigned 32-bit max |
How to use the Hex to Decimal
- Paste the hex value. Swap the sample FF for your digits; 0x, lowercase letters and single spaces between groups are all accepted.
- Read the base-10 number. The decimal value appears as you type, or a message points to the first character that isn't 0–9 or A–F.
- Copy the decimal. Press Copy Result to take the number into a spreadsheet, form or bug report.
Frequently asked questions
What is FF in decimal?
255. F is fifteen, so FF means 15 × 16 + 15 = 240 + 15 = 255. In the same way FFFF is 65535 and FFFFFF is 16777215, the decimal value of the colour white.
How do I convert a hex colour code like #1E90FF to decimal?
Remove the #. Pasting 1E90FF gives 2003199 as one number. For the red, green and blue values, convert each pair on its own: 1E is 30, 90 is 144 and FF is 255, so rgb(30, 144, 255).
Why does my hex number give a big positive value instead of a negative one?
Because the converter treats hex as an unsigned number. If your value is a signed integer and its first digit is 8 to F, subtract 16 to the power of the digit count. For FFFFFF85 in 32 bits that is 4294967173 − 4294967296 = −123.
Does it matter if I type hex letters in lowercase?
No. ff, Ff and FF all give 255. Hex digits are case-insensitive by convention, and the converter upper-cases them before reading, so you can paste straight from a log or a terminal.
What do the letters A to F mean in hexadecimal?
Base 16 needs sixteen single digits, but decimal only supplies ten, 0 to 9. The letters A, B, C, D, E and F fill the gap and stand for 10, 11, 12, 13, 14 and 15.
Is the hex I paste kept or uploaded?
No. Your browser does the conversion on your own device, and the value isn't sent or stored anywhere, so an address or ID copied from a private log stays on your device.
This tool runs entirely in your browser. What you enter or upload stays on your device and is never sent to our servers.