Hexadecimal and decimal
Hexadecimal (base 16) writes each group of 4 bits as one digit from 0 to F, so one byte is always two hex digits; it is the language of memory addresses, colors and hashes. Decimal (base 10) is the everyday system: each digit is worth a power of 10.
Hex shows up in error codes (0x80070005), memory addresses, HTTP/2 frames and colors; converting to decimal tells you the actual quantity.
This page opens the base converter with hexadecimal as the input; it shows binary, octal, decimal, hexadecimal and Base64 at once, accepts prefixes such as 0x, 0b and 0o, and works with numbers of any length (no 2^53 limit). It runs in your browser.
Hexadecimal vs decimal
| Hexadecimal | decimal | |
|---|---|---|
| Base | 16 | 10 |
| Digits | 0–9 A–F | 0–9 |
| Prefix in code | 0x | — |
| 255 is written | FF | 255 |
How to convert hexadecimal to decimal by hand
Multiply each digit by the power of 16 of its position (counting from 0 on the right) and add everything. For 9C:
9 × 16^1 + 12 × 16^0
= 144 + 12
= 156Hexadecimal to decimal table
Values computed by the converter itself:
| Hexadecimal | Decimal |
|---|---|
0 | 0 |
1 | 1 |
2 | 2 |
7 | 7 |
8 | 8 |
A | 10 |
F | 15 |
10 | 16 |
20 | 32 |
40 | 64 |
64 | 100 |
7F | 127 |
FF | 255 |
100 | 256 |
3E8 | 1000 |
400 | 1024 |
1000 | 4096 |
FFFF | 65535 |
Hexadecimal to decimal in code
JavaScript
parseInt('9C', 16); // 156Python
int("9C", 16) # 156For integers beyond 2^53 in JavaScript, use BigInt: BigInt("0x…").toString(10).
Frequently asked questions
Does it handle very large numbers?
Yes. The converter uses arbitrary-precision integers (BigInt), so a 256-bit hash or a 100-digit number converts exactly; JavaScript Number would lose digits above 2^53.
Can I convert negative numbers or fractions?
Negative integers keep their sign (-255 → -FF); the tool does not write two’s complement or fractional digits. For a two’s complement byte, add 256 first (−1 → 255 → FF).
Why do programmers use hexadecimal instead of binary?
Because it is binary in short form: 4 bits per digit, 2 digits per byte, so 0xFF is easier to read than 11111111 and still maps bit for bit.