Reading hexadecimal
Hexadecimal is base 16. It uses the digits 0–9 and the letters A–F for ten to fifteen, and each position is worth sixteen times the one to its right: 1, 16, 256, 4,096, 65,536… One hex digit stands for exactly four bits, so two digits make a byte. That is why memory addresses, colour codes, MAC addresses, error codes and hashes are written in hex.
Worked example
0x1F4: 1 × 256 + 15 × 16 + 4 × 1 = 256 + 240 + 4 = 500. FF is 15 × 16 + 15 = 255, the largest byte, and DEADBEEF, a classic debugging marker, is 3,735,928,559.
Signed values
Hex dumps often hold signed integers in two's complement. This page reads hex as an unsigned number: FFFFFFFF is 4,294,967,295. As a 32-bit signed integer the same bits mean −1; subtract 2^32 from values at or above 0x80000000 to get the signed reading.
How this works
The page reads the hex digits from left to right, multiplying the running total by 16 and adding each digit's value (Horner's method). JavaScript's BigInt keeps the arithmetic exact for any length, so 64-bit and 128-bit values convert without rounding. Upper and lower case are equivalent, a 0x prefix is optional, and spaces or underscores between digits are ignored. The table shows the same value in binary, octal, decimal and hex and its length in bits. Each line converts separately.
Frequently asked
How do I convert hex to decimal by hand?
Multiply each digit by 16 to the power of its position from the right, starting at 0, and add. 2A = 2 × 16 + 10 = 42.
What are A to F in hex?
A = 10, B = 11, C = 12, D = 13, E = 14, F = 15.
Why is FFFFFFFF not −1?
The page reads hex as unsigned. In a 32-bit signed integer the same bits mean −1.
Does case matter?
No. 0xff and 0xFF are the same number.
Sources
- ECMA-262 — ECMAScript Language Specification
- ISO 80000-1:2022 — Quantities and units — Part 1: General
- Wikipedia — Hexadecimal
Reviewed Oct 17, 2026 · test vectors fixtures/dev/hex-to-decimal/