Boneyard Tools

Hex to Binary Converter

Paste a hexadecimal value and read its base-2 form the moment you stop typing. A 0x prefix is optional, spaces between bytes are ignored, and a padding toggle lines the output up into clean 4-bit nibbles. Conversion runs on BigInt in your browser, so even 64-bit and larger values stay exact.

How to convert hex to binary

  1. Type or paste your hexadecimal digits into the 'Hexadecimal input' box, or press 'Load sample' to try DE AD BE EF.
  2. Leave the 0x prefix in or drop it, and space out bytes however you like. Both are stripped before conversion.
  3. Tick 'Pad to 4-bit groups' if you want every nibble to keep its leading zeros.
  4. Read the base-2 result in the 'Binary output' box below.
  5. Use the Copy button to put the binary string on your clipboard.

Examples

One byte, prefix stripped

0xFF
11111111

Four bytes with spaces ignored

DE AD BE EF
11011110101011011011111011101111

Single nibble with padding on

5
0101

Frequently asked questions

How does one hex digit map to binary?

Each hexadecimal digit is exactly four binary digits, a group called a nibble. F is 1111, A is 1010, 8 is 1000 and 0 is 0000, so you can translate a value one digit at a time and concatenate the nibbles.

Why does the output sometimes have fewer digits than I expect?

Binary numbers drop leading zeros, so hex 5 becomes 101 rather than 0101. Turn on 'Pad to 4-bit groups' and the tool left-pads the whole result to the next multiple of four bits, so 5 becomes 0101 and every nibble keeps its width.

Does padding align to bytes or to nibbles?

It aligns to nibbles, meaning multiples of four bits, not eight. Hex value 1F pads to 00011111 (eight bits, which is also a byte here), but a three-nibble value pads to twelve bits rather than sixteen. If you need whole bytes, feed input that is a whole number of byte pairs.

Do I need the 0x prefix?

No. The 0x or 0X prefix is optional and case-insensitive, so FF, 0xFF and 0XFF all produce 11111111. Whitespace between digits is removed too, which is why grouped input like DE AD BE EF converts cleanly.

Can it handle very large hex values?

Yes. Conversion uses JavaScript BigInt, so there is no fixed width limit and no floating-point rounding. Long hashes, 128-bit UUIDs and larger integers convert exactly.

Are uppercase and lowercase hex both accepted?

Yes. Digits a through f and A through F are treated the same, so deadbeef and DEADBEEF give identical binary output.

What happens if I type an invalid character?

Anything outside 0-9 and a-f triggers an 'Invalid hexadecimal' message in red under the input, and the binary box stays empty until you fix it. Letters like g through z, punctuation and a stray minus sign all count as invalid.

What does an empty box produce?

An empty input, or one that is only spaces and a 0x prefix, returns an empty binary output rather than an error. Nothing is shown until there is at least one valid hex digit to convert.

Is my data uploaded anywhere?

No. The conversion runs entirely in your browser with client-side JavaScript, so the hex you paste never leaves your device. The optional JSON API is separate and only runs when you call it directly.

Learn more

Related tools