Hex to Binary Converter
Hexadecimal (base 16) and binary (base 2) are tightly linked: because 16 is 2 to the fourth power, every single hex digit maps to exactly four binary bits. That makes hex a compact shorthand for the long bit strings computers actually use. Enter a hexadecimal value and this converter returns the binary equivalent, the decimal value, and the octal value. The binary output is grouped in nibbles of four bits so you can read each hex digit directly. Valid hex digits are 0 to 9 and A to F.
Hex to binary formula
Each hex digit = one 4-bit nibble (16 = 2 ^ 4)
0 = 0000, 1 = 0001, ... 9 = 1001
A = 1010, B = 1011, C = 1100, D = 1101, E = 1110, F = 1111
Decimal = sum of (digit value * 16 ^ position)
Octal = decimal value rewritten in base 8
Concatenate each digit's nibble to form the full binary string. The hex value 3A maps to 0011 then 1010.
Hex and binary context
- Two hex digits represent exactly one byte (8 bits), so a byte ranges 00 to FF.
- HTML and CSS color codes such as #FF8800 are three bytes of hex: red, green, and blue.
- Memory addresses and machine instructions are conventionally displayed in hex.
- The 0x prefix marks a hex literal in many programming languages; this tool accepts values with or without it.
- A 32-bit integer fits in 8 hex digits; a 64-bit integer fits in 16 hex digits.
Hex to binary converter: frequently asked questions
How do you convert hex to binary?
Each hexadecimal digit maps to exactly four binary bits, because 16 equals 2 to the power of 4. Replace each hex digit with its 4-bit pattern: for example A is 1010, F is 1111, and 3 is 0011. The hex value 3A becomes 0011 1010 in binary.
Why is hexadecimal used in computing?
Hexadecimal is a compact way to write binary. One hex digit represents four bits and two hex digits represent one byte, so a 32-bit value needs only eight hex digits instead of 32 binary digits. Memory addresses, color codes, and machine code are commonly written in hex.
What characters are valid in a hex number?
Hexadecimal uses sixteen symbols: 0 through 9 for values zero to nine, and A through F (or lowercase a to f) for values ten to fifteen. Any other character makes the value invalid.
How do I convert hex to decimal?
Multiply each hex digit by 16 raised to the power of its position, counting from zero on the right, then sum. The hex value 2F equals 2 times 16 plus 15 times 1, which is 32 plus 15, equal to 47 in decimal.
What is the largest value this converter accepts?
This converter handles values up to the safe integer limit of JavaScript, which is 2 to the power of 53 minus 1. That covers up to 13 hex digits exactly. Larger values are flagged as out of range to avoid precision errors.
Official sources
- NIST: National Institute of Standards and Technology, positional number systems reference.
- IETF RFC Editor: RFC 4648, Base16 (hexadecimal) encoding.
Reviewed by the CalculatorHub team, edited by James Graham, 17 June 2026. See our methodology.