Hex to Binary
Convert hex numbers to binary in your browser. Output one binary value per line, padded to 4-bit nibbles, with optional spacing between bytes.
Hex in, binary out
Each hex digit unpacks to four binary digits. Optional padding aligns each value to nibble or byte boundaries.
a ff 2a
1010 11111111 101010
What you'll use this for
Binary is the natural form when bit-level structure matters — flags, masks, hardware registers, and packed fields.
Bit twiddling
See exactly which bits are set when working with flags and bitmasks.
Hardware register debug
Map register hex values to bit patterns.
CS homework
Quickly verify base-conversion exercises and bit-twiddling answers.
Color analysis
Inspect the bit pattern of an RGB or RGBA hex color.
How to convert hex to binary
Paste hex numbers
One per line, or separated by spaces or commas. 0x prefixes are stripped automatically.
Pick padding & grouping
Pad to 4 / 8 / 16 / 32 bits, and optionally insert spaces every nibble or byte for readability.
Click Convert
Or leave auto-convert on for live updates. Runs locally — no upload.
Copy or download
Copy to clipboard or save as .txt. Round-trip via the reverse tool to verify.
Frequently asked questions
No. FF and ff both work.
Yes — perfect for byte-by-byte bit analysis.
Yes.
Whitespace, newlines, or commas. 0x prefixes are stripped.
About hex-to-binary conversion
Hexadecimal (base 16) uses 16 symbols — 0-9a-f — to represent four binary digits at a time. Because four bits map to exactly one hex digit, the conversion is loss-free and nibble-aligned: every hex digit unpacks to the same four binary digits, every time.
Why nibble-aligned
- Hardware registers, memory addresses, and color values are naturally byte-aligned.
- Padding to 8 / 16 / 32 bits makes byte and word boundaries visually obvious.
- Grouping bits in chunks of 4 or 8 aids quick visual scanning.
How this converter works
- Splits input on whitespace and commas, strips any
0xprefix and stray characters. - Parses with
parseInt(t, 16)and emits the value viatoString(2). - Pad width, bit grouping, and
0bprefix shape the output.