Hex to decimal — base-16 to base-10
Paste any hexadecimal value, with or without a 0x prefix, and this tool
returns the decimal (base 10) number, plus the binary and octal
equivalents. Hexadecimal is the compact base programmers use for colours, memory
addresses, and byte data, because each digit maps neatly to four binary bits.
How it works
The tool strips an optional 0x prefix and any spaces, checks the remaining text
contains only valid hex digits (0–9, A–F), and parses it as base 16. Internally
each digit contributes its value times a power of sixteen: the rightmost digit is
16⁰ = 1, the next is 16¹ = 16, then 16² = 256, and so on. The decimal result is
the sum, and the binary and octal forms are derived from the same number. If a
value exceeds the safe-integer range it is rejected to avoid silent rounding.
Example
Convert 0xBEEF:
- B = 11 → 11 × 16³ = 45056
- E = 14 → 14 × 16² = 3584
- E = 14 → 14 × 16¹ = 224
- F = 15 → 15 × 16⁰ = 15
- Total = 48879
| Hex | Decimal | Binary | Octal |
|---|---|---|---|
| F | 15 | 1111 | 17 |
| FF | 255 | 11111111 | 377 |
| 100 | 256 | 100000000 | 400 |
| BEEF | 48879 | 1011111011101111 | 137357 |
Everything runs in your browser — nothing is uploaded.
Where you encounter hex values in practice
Hexadecimal appears in many everyday programming contexts, and being able to quickly convert it to decimal helps with debugging and understanding what you are looking at:
- Colour codes —
#FF8800in CSS means red=255, green=136, blue=0 in decimal. - Memory addresses — debuggers and disassemblers display addresses like
0x7fff5fbff5c0. The decimal equivalent tells you the absolute memory offset. - HTTP status codes in logs — some tools log status codes as hex;
0xC8is 200,0x194is 404. - File signatures (magic bytes) — the JPEG format starts with
FF D8 FF. Knowing thatFF= 255 helps when reading hex dumps. - Unicode code points —
U+1F600is the decimal value 128512, the grinning face emoji.
Common pitfalls
Case sensitivity — hex digits A–F can be upper or lower case; both mean the same thing, and this tool accepts either.
The 0x prefix is optional — both BEEF and 0xBEEF give the same result. Some tools and languages require the prefix while others reject it, so being able to strip or add it mentally is useful.
Leading zeros are harmless — 0x0042 is the same as 0x42, which is decimal 66. Leading zeros do not change the value, though they are often there to pad a value to a fixed byte width.
Watch the safe-integer ceiling — JavaScript (which powers this tool) represents integers exactly up to 2⁵³ − 1. The corresponding hex value is 0x1FFFFFFFFFFFFF. Larger values are rejected with an error rather than returning a silently wrong result.
How to read the binary and octal outputs
Each hex digit equals exactly four binary bits, so converting hex to binary is especially direct — just replace each digit with its four-bit group. For example, BEEF in binary is 1011 1110 1110 1111 (B=1011, E=1110, E=1110, F=1111). Octal groups binary digits in threes rather than fours, which is why the same value produces a different-looking octal number. Programmers use binary when working with bit masks and flags, and octal mainly for Unix file permissions (where 755 = 111 101 101 in binary, meaning read/write/execute for owner and read/execute for group and others).