Hexadecimal Converter

Hexadecimal (base-16) is everywhere in computing — memory addresses, color codes, character encodings, and cryptographic hashes all use hex because one hex digit represents exactly 4 binary bits, making it the most compact human-readable format for binary data.

hexadecimal (Base 16)

Notes

The 16 Hex Digits and Their Values

Hex uses digits 0–9 plus six letters A–F. The letters represent the values 10–15 that have no single-character decimal equivalent. This is why one hex digit can represent exactly 16 values (0–15), matching a 4-bit binary number.

HexDecimal4-bit BinaryHexDecimal4-bit Binary
000000881000
110001991001
220010A101010
330011B111011
440100C121100
550101D131101
660110E141110
770111F151111

Hex → Decimal: Positional Notation

Replace each hex letter with its numeric value (A=10, B=11…F=15), then multiply each digit by 16 raised to its positional power and sum the results.

Hex → Binary: Direct 4-Bit Substitution

Replace each hex digit with its 4-bit binary equivalent from the table above. This is the fastest conversion — no arithmetic at all.

Example: (ABF3)₁₆ → A=1010, B=1011, F=1111, 3=0011 → (1010 1011 1111 0011)₂

Hex → Octal: Via Binary

Expand each hex digit to 4 binary bits, concatenate all bits, regroup into 3-bit chunks from right to left, then map each chunk to its octal digit.

💡Example: (FC)₁₆ → F=1111, C=1100 → bits: 11111100 → groups: 011 | 111 | 100 → Octal 374₈.

Real-World Examples of Hexadecimal

Use caseHex valueMeaning
Web color#FF5733Red=255, Green=87, Blue=51
ASCII 'A'0x41Decimal 65 → binary 01000001
Max 1 byte0xFFDecimal 255 → all 8 bits set
SHA-256 start0x6a09e667Part of first hash constant
IPv4 loopback0x7F000001127.0.0.1 in hex

Frequently Asked Questions

Are hex digits A–F case-sensitive?

No. A and a represent the same value (10). Uppercase is conventional for hardware, memory dumps, and assembly; lowercase is common in CSS colors and cryptographic hashes. This converter accepts both and outputs uppercase.

How do I decode a web color code like #3498DB?

Split into three 2-digit pairs: R=34, G=98, B=DB. Convert each pair: 34₁₆ = 52₁₀, 98₁₆ = 152₁₀, DB₁₆ = 219₁₀. So the color is RGB(52, 152, 219) — a medium blue.

Why does a byte always need exactly two hex digits?

One byte = 8 bits = two groups of 4 bits. Since one hex digit = 4 bits, one byte = exactly two hex digits. This is why memory sizes, color codes, and ASCII values are always shown as 2-digit hex pairs (00 through FF).

What does 0x mean before a hex number?

0x is the standard programming prefix indicating a hexadecimal literal. For example, 0xFF means the hex value FF = decimal 255. Other notations include a trailing 'h' (FFh) or a subscript 16 (FF₁₆).