Place value in base 16
Decimal numbers are built from powers of 10: 2,019 means 2 × 1000 + 0 × 100 + 1 × 10 + 9 × 1. Hexadecimal works the same way with powers of 16. From the right, the places are worth 1, 16, 256, 4,096, 65,536 and so on, each sixteen times the last.
The sixteen digits are 0 to 9 followed by A = 10, B = 11, C = 12, D = 13, E = 14 and F = 15.
To convert, multiply each digit by its place value and add up the results.
Example: 7E3
| Digit | Value | Place | Product |
|---|---|---|---|
| 7 | 7 | 16² = 256 | 1,792 |
| E | 14 | 16¹ = 16 | 224 |
| 3 | 3 | 16⁰ = 1 | 3 |
| Total | 2,019 |
The tool builds this table for any input, up to numbers far larger than a calculator can hold. It uses JavaScript's BigInt, so a 40-digit hash converts exactly instead of losing precision after about 16 digits.
Handy values to remember
| Hex | Decimal | Where you see it |
|---|---|---|
| FF | 255 | max of one byte; one RGB channel |
| 100 | 256 | number of values in a byte |
| 3E8 | 1,000 | |
| FFFF | 65,535 | max unsigned 16-bit value; highest TCP/UDP port |
| 10000 | 65,536 | |
| 7FFFFFFF | 2,147,483,647 | max signed 32-bit integer |
| FFFFFFFF | 4,294,967,295 | max unsigned 32-bit integer |
| DEADBEEF | 3,735,928,559 | classic debug fill pattern |
| 1FFFFFFFFFFFFF | 9,007,199,254,740,991 | largest integer a JavaScript Number holds exactly |
Signed values and two's complement
Computers store negative integers in two's complement. In a fixed width, the top bit acts as a sign. If it is 1, the number is negative, and its value is the unsigned reading minus 2 to the power of the width.
Tick Read as signed and pick a width to see this:
FFat 8 bits: 255 − 256 = −180at 8 bits: 128 − 256 = −128, the most negative 8-bit value7Fat 8 bits: top bit is 0, so it stays 127FFD6at 16 bits: 65,494 − 65,536 = −42
The same digits mean different numbers depending on width. FF is −1 as an 8-bit value but 255 at 16 bits, where the top bit is 0. When reading a register dump or a network packet, check the width in the spec before interpreting the sign.
Accepted input
- With or without a
0xprefix:0x1A4and1A4both give 420. - Upper or lower case.
- Spaces and underscores as separators, as in
DEAD_BEEForFF FF. They are stripped before converting. - A leading minus sign for a plainly negative hex value:
-FFis −255. This is not two's complement, just a negative number written in base 16.
Anything else, such as a G or a stray letter O, is flagged rather than silently dropped.
Bulk lists
Open Bulk and paste one value per line, for example a column copied from a log file or a spreadsheet. Each line is converted on its own and invalid lines are labeled, so the output still lines up with your input when you paste it back.
Where hex-to-decimal shows up
- Colors. Each pair in a HEX color code is a byte, so
#D9481Cis 217, 72, 28. The HEX to RGB converter does that split for you. - Memory addresses and offsets in debuggers and crash logs.
- Error codes such as Windows HRESULTs (
0x80070005is 2,147,942,405 unsigned, or −2,147,024,891 as a signed 32-bit value). - Unicode code points: U+00E9 (é) is 233.
- File formats and checksums viewed in a hex editor.
Related tools
The reverse conversion, with the division method shown, is decimal to hex. For arithmetic and bitwise operations on hex values, use the hex calculator. To see the bit pattern, try hex to binary.
FAQ
Why does my calculator give a different answer for long hex numbers?
Most calculators and spreadsheets use 64-bit floating point, which is exact only up to 2⁵³. Beyond that the last digits are rounded. This tool uses arbitrary-precision integers, so the answer is exact at any length.
Is hex to decimal the same as hex to ASCII?
No. Hex to decimal reads the whole string as one number. Hex to ASCII reads it two digits at a time as character codes. For that, use the hex to text converter.
What does the "h" suffix mean, as in 7E3h?
It's an older notation for hex used in assembly language and some datasheets. Remove the h before pasting.