Hex to Binary Converter
Convert a hexadecimal value to binary right in your browser. Each hex digit expands to exactly 4 binary digits, and the result is grouped into space-separated nibbles.
How to use this tool
- 1
Type or paste a hex value into the input box, for example 1A2B or 0x1A2B.
- 2
An optional leading 0x and any spaces are removed automatically before conversion.
- 3
Read the binary result below the box, shown as 4-bit groups separated by spaces.
- 4
If the box stays empty, check your input contains only the digits 0-9 and letters A-F.
What is hexadecimal-to-binary conversion?
Hexadecimal (base 16) and binary (base 2) are both ways of writing the same numbers, and converting between them is a fixed digit-by-digit substitution. Because 16 is 2 to the fourth power, every single hex digit maps to exactly one group of four binary digits, called a nibble: 0 becomes 0000, 9 becomes 1001, A becomes 1010, and F becomes 1111. This clean alignment is why hex is so popular for writing out binary data compactly. To convert, you replace each hex digit with its 4-bit pattern and concatenate the results; no arithmetic on the whole number is needed. This tool does exactly that. It first strips an optional leading 0x and removes any whitespace, then checks the remaining text against the digits 0-9 and the letters a-f or A-F. If the string is valid, each character is converted with parseInt(digit, 16) and padded to 4 bits, then the nibbles are joined with spaces for readability. Note that it treats the input purely as a sequence of hex digits, so it does not handle signed values, a minus sign, fractional points, or 0b-style prefixes; anything outside 0-9 and A-F simply produces no output.
Common use cases
Decoding a hex color like FF8800 into its red, green, and blue bit patterns when working on a design or shader.
Inspecting the binary layout of a memory address or register value printed by a debugger.
Teaching or learning how each hex digit corresponds to a 4-bit nibble in a computer-science class.
Checking the bit pattern of a hardware flag or bitmask defined in hex in firmware or driver code.
Translating a hex opcode or byte from a disassembly into binary to read individual instruction fields.
Verifying that a hex constant in a config file expands to the bit pattern you expect before committing it.
Frequently asked questions
Does it accept a 0x prefix?▼
What happens to spaces in my input?▼
Why is the output blank?▼
Why is the result grouped into 4-bit chunks?▼
Can it convert negative or fractional hex values?▼
Is there a length limit?▼
Is my data uploaded anywhere?▼
Related tools
JSON to CSV Converter
Convert JSON arrays to CSV.
CSV to JSON Converter
Convert CSV to JSON arrays.
CSV to SQL INSERT
Generate SQL INSERT statements from CSV.
Binary to Hex Converter
Convert binary numbers to hexadecimal.
Decimal to Binary Converter
Convert decimal numbers to binary, hex, octal.
ASCII to Hex Converter
Convert text to ASCII hex codes and back.