Hex to decimal
Rewrite any whole number from base 16 to base 10, with a table of the values that come up most often.
Converter
Hexadecimal (base 16) to Decimal (base 10) at a glance
21 rows| Hexadecimal (base 16) | Decimal (base 10) |
|---|---|
| 1 hex | 1 dec |
| 2 hex | 2 dec |
| 3 hex | 3 dec |
| 4 hex | 4 dec |
| 5 hex | 5 dec |
| 6 hex | 6 dec |
| 7 hex | 7 dec |
| 8 hex | 8 dec |
| 9 hex | 9 dec |
| 10 hex | 10 dec |
| 15 hex | 15 dec |
| 20 hex | 20 dec |
| 25 hex | 25 dec |
| 30 hex | 30 dec |
| 40 hex | 40 dec |
| 50 hex | 50 dec |
| 75 hex | 75 dec |
| 100 hex | 100 dec |
| 250 hex | 250 dec |
| 500 hex | 500 dec |
| 1,000 hex | 1,000 dec |
Quick pairs
tap to loadWhy people convert hex to decimal
Hexadecimal shows up constantly in web design color codes, memory addresses, and error codes, because it maps cleanly onto binary, four binary digits to one hex digit, in a way decimal does not. A color code like #FF0000, pure red, converts to decimal RGB values of 255, 0, 0, a conversion web developers run informally just by recognizing FF as the maximum byte value.
Debugging sessions hit the same conversion from a different angle: a crash log or memory dump reports an address or offset in hex, such as 0x1A3, and comparing it against an array index or byte count calculated in ordinary decimal arithmetic means converting one of the two numbers before they can be compared directly.
Popular number base conversions
1 pagesHow the hexadecimal (base 16) to decimal (base 10) conversion works
Hexadecimal is positional notation in base 16: each digit's place value, from the right starting at position 0, is a power of 16 — 1, 16, 256, 4096 — and digits A through F stand in for the values 10 through 15.
Take the two-digit hex number 2F: F is 15, so the value is 2×16 + 15×1 = 32 + 15 = 47.
A different two-digit example, 2E (E is 14), gives 2×16 + 14×1 = 32 + 14 = 46.
A three-digit example, 1A3 (A is 10), uses place values 256, 16, 1: 1×256 + 10×16 + 3×1 = 256 + 160 + 3 = 419.
A useful sanity check: since 16 is even, the last hex digit's own parity matches the whole number's parity. 2F ends in F (15, odd), and 47 is odd; 2E ends in E (14, even), and 46 is even — both confirm the arithmetic above without redoing the full expansion.
The mistake specific to this pair is misreading a letter digit — confusing B (11) with 8, or forgetting that hex letters are case-insensitive so b and B mean the same value — or occasionally treating a letter as its position in the alphabet (A=1) instead of its actual value in this scheme (A=10).
Questions
How do I convert a decimal number back to hexadecimal?
Divide repeatedly by 16 and read the remainders from last to first, converting any remainder of 10–15 to A–F. For 419: 419÷16=26 r3, 26÷16=1 r10 (A), 1÷16=0 r1. Reading bottom-to-top gives 1A3, matching the example above.
Why is hexadecimal used instead of binary or decimal in programming?
Each hex digit represents exactly 4 binary digits, so two hex digits represent one full byte (00 to FF covers 0–255) — far more compact and readable than writing out 8 binary digits, while still converting cleanly to binary, unlike decimal.
Is there a quick way to convert common hex values in my head?
Memorize the place values 16, 256, and 4096, and that FF always equals 255 (the maximum value of a byte) — recognizing FF or F0-style patterns instantly saves working through the full expansion for the most common cases.
What's the most common mistake when converting hex to decimal?
Misreading a letter digit, such as confusing B (11) with the digit 8, or forgetting hex letters are case-insensitive, so lowercase and uppercase versions of the same letter must be read as the identical value.
Why do hex color codes always come in pairs of two digits, like FF0000?
Each color channel (red, green, blue) is stored as one byte, 0–255 in decimal, and two hex digits exactly cover that range (00 to FF) with nothing wasted, which is why color codes are always written in two-digit groups rather than one or three.
More on precision and what leaves your device: see About and Privacy policy.