Hex to Decimal Converter
Convert hexadecimal to decimal, binary, and octal — bidirectional, supports 0x
Hex → Decimal / Binary / Octal
Decimal
Binary
Octal
Decimal → Hex (bidirectional)
Hexadecimal
Binary
Octal
Hex digit reference ▸
| Hex | Decimal | Binary | Octal |
|---|---|---|---|
| 0 | 0 | 0000 | 0 |
| 1 | 1 | 0001 | 1 |
| A | 10 | 1010 | 12 |
| B | 11 | 1011 | 13 |
| C | 12 | 1100 | 14 |
| D | 13 | 1101 | 15 |
| E | 14 | 1110 | 16 |
| F | 15 | 1111 | 17 |
| FF | 255 | 11111111 | 377 |
| 1000 | 4096 | 1000000000000 | 10000 |
Hexadecimal appears everywhere in development: HTML color codes, memory addresses, byte values in network packets, hash outputs, Unicode codepoints. The hex system exists because it maps cleanly to binary — 2 hex digits = 1 byte — and compresses long binary strings into something humans can actually read. This converter translates between hex and decimal (plus binary and octal) instantly.
What Is Hexadecimal (Base 16)?
Hexadecimal is a base-16 positional numeral system. It uses 16 symbols: 0–9 for values 0–9, and A–F (or a–f) for values 10–15.
| Hex | Decimal | Binary |
|---|---|---|
| 0–9 | 0–9 | 0000–1001 |
| A | 10 | 1010 |
| B | 11 | 1011 |
| C | 12 | 1100 |
| D | 13 | 1101 |
| E | 14 | 1110 |
| F | 15 | 1111 |
The 0x prefix (e.g., 0xFF) is a programming convention indicating a hexadecimal literal. This tool accepts both FF and 0xFF.
How Hex to Decimal Conversion Works
Multiply each hex digit by its positional power of 16 and sum.
Example: 1A3 → decimal
1A3 = 1×16² + 10×16¹ + 3×16⁰
= 256 + 160 + 3 = 419
Example: FF → decimal
FF = 15×16¹ + 15×16⁰ = 240 + 15 = 255
0xFF is the maximum value of a single byte — which is why you see it constantly in color codes, bitmasks, and byte-level operations.
Why Hex Maps Perfectly to Binary
One hex digit = exactly 4 bits (a nibble). Two hex digits = exactly 1 byte (8 bits). This isn’t coincidence — 16 = 2⁴, so every possible hex digit maps to a unique 4-bit pattern.
0xFF = 1111 1111 (all bits set, 255 decimal)
0x0F = 0000 1111 (low nibble only, 15 decimal)
0xF0 = 1111 0000 (high nibble only, 240 decimal)
This is why developers use hex instead of decimal for bitmasks: value & 0xFF (extract low byte) is immediately readable as a bit operation; value & 255 is not.
Real-World Hex Values You’ll Encounter
HTML/CSS Colors
CSS hex colors are three bytes — red, green, blue:
#FF0000= rgb(255, 0, 0) = full red#00FF00= rgb(0, 255, 0) = full green#1A1A2E= rgb(26, 26, 46) = dark navy
Shorthand #FFF = #FFFFFF because each digit is doubled.
Memory Addresses (x86-64)
64-bit pointers are written as 16 hex digits: 0x00007FFD4B2A1C30. The 0x prefix signals to readers that this is a hexadecimal memory address, not a decimal number.
Unicode Codepoints
Characters are identified by hex codepoints:
U+0041= ‘A’ (decimal 65)U+00E9= ‘é’ (decimal 233)U+1F600= 😀 (decimal 128512)
Status Codes and Flags
HTTP status 404 = 0x194. Error codes in Windows are hexadecimal: 0xC0000005 (access violation), 0x80070057 (invalid parameter).
Converting Decimal to Hex
To convert decimal to hex, repeatedly divide by 16 and record remainders:
419 ÷ 16 = 26 remainder 3 → 3
26 ÷ 16 = 1 remainder 10 → A
1 ÷ 16 = 0 remainder 1 → 1
Read remainders bottom to top: 1A3
Or just use the tool above — the “Decimal → Hex” panel does this instantly.
Frequently Asked Questions
What does 0x mean in front of a number?
It’s a programming prefix indicating the following digits are in base 16 (hexadecimal). Originating from C, it’s now used in virtually every programming language. 0xFF = 255 decimal.
Is hex case-sensitive?
No. 0xFF and 0XFF and FF and ff all represent the same value. Uppercase is conventional for standalone values; lowercase is common in CSS color codes.
Why are hex numbers often 2, 4, or 8 digits long? Because 2 hex digits = 1 byte, 4 hex digits = 2 bytes (16-bit word), 8 hex digits = 4 bytes (32-bit word). Padding to even digit counts makes the byte boundaries immediately visible.
Privacy
All conversions run entirely in your browser. No data is transmitted to any server.