Hex to decimal: making a hexadecimal value mean something
What this conversion does
It reads a base 16 value and restates it in base 10. Hexadecimal is convenient for machines and for anyone comparing bit patterns, but a decimal figure is what you need for thresholds, byte sizes and anything a person has to judge at a glance. This direction is the one you reach for when a tool hands you a value and stops explaining.
Position weights are powers of 16
Reading from the right, each hexadecimal digit is multiplied by 1, 16, 256, 4096 and so on. For 1E90FF the value is 1 × 16 to the fifth plus 14 × 16 to the fourth and onward, which comes to 2003199. The arithmetic is the same weighted sum used in every base; only the weights change, which is why the same method works for binary and octal too.
Hexadecimal to decimal conversion table
Hexadecimal values that appear routinely in debugging and web work, with their decimal equivalents. The round hexadecimal numbers are the ones worth remembering, since they mark byte and page boundaries.
| Hexadecimal | Decimal |
|---|---|
| 0 | 0 |
| 1 | 1 |
| F | 15 |
| 10 | 16 |
| 7F | 127 |
| A5 | 165 |
| FF | 255 |
| 1000 | 4096 |
| FFFF | 65535 |
| DEADBEEF | 3735928559 |
What people actually decode
The three recurring jobs are reading a colour channel, checking a memory address against a boundary, and turning a truncated hash into something comparable. Colour is the friendliest example: 0x1E90FF splits into 30, 144 and 255, which tells you the blue channel is saturated and the red channel is weak. The same three-step reading applies to any packed value, and it is much easier once the bytes are separated.
Split the value before you convert it
A six-digit colour or a long address is easier to read in two-digit groups, because each group is one byte. Converting the whole value at once is fine for a single answer, but splitting it first is what lets you see which byte is unusual — and that is usually the actual question.
Frequently asked questions
How do I convert hex to decimal by hand?
Multiply each digit by its place value — 1, 16, 256, 4096 and so on from the right — and add the results. Remember that A is 10, B is 11 and up to F for 15. For 1E90FF that gives 1048576 + 917504 + 36864 + 0 + 240 + 15, which is 2003199.
Why do memory addresses look like long hex numbers?
Because they are naturally aligned to byte and word boundaries, and hexadecimal digits line up with those boundaries in a way decimal digits do not. Two hex digits are one byte, so the leading digits of an address describe its page and the trailing digits describe its offset within that page.
Can I paste a value with the 0x prefix?
Yes, the prefix is recognised and removed before converting, so a value copied straight out of a debugger or source file works without editing. A prefix that does not match the page you are on is reported rather than quietly ignored, which avoids a misread value slipping through.
How large can the hexadecimal value be?
Sixty-four bits and well beyond. Values at the top of that range exceed what ordinary floating-point arithmetic holds exactly, so the conversion runs in exact integer arithmetic and returns every digit correctly rather than the rounded answer a spreadsheet would give.
Is a hash prefix meaningful as a number?
Arithmetically yes, practically no. Converting the first few bytes of a hash to decimal is useful for spotting patterns or scripting a comparison, but a truncated hash has lost the property that made it a hash, so do not treat the decimal form as an identifier in its own right.