HEX to Binary Converter

Every hex digit maps to exactly 4 bits, so hex-to-binary is the cleanest base conversion you can do. Paste one or many hex values and this tool produces the binary string with each digit expanded to a zero-padded 4-bit nibble, handy for bitfield documentation, firmware registers and low-level debugging.

How to convert hex to binary

  1. 1

    Paste hex input

    Type any mix of 0-9 and a-f; prefixes like `0x` and any separators are removed automatically.

  2. 2

    Each digit becomes 4 bits

    Every hex digit is expanded to its 4-bit binary equivalent, so the output is always 4 bits per digit.

  3. 3

    Leading zeros are always kept

    Every nibble keeps its full 4 bits so byte boundaries stay aligned; there is no trimming option.

  4. 4

    Copy the binary

    The output is a pure `0/1` string grouped in 4-bit nibbles, ready to paste into documentation, firmware comments or a calculator.

The hex-to-binary mapping

Hex is a compact view of binary: 2 hex digits = 1 byte = 8 bits. Mentally translating between them is fast because each hex digit covers exactly 4 bits.

Nibble lookup table

Hex Binary Decimal
0 0000 0
1 0001 1
2 0010 2
3 0011 3
4 0100 4
5 0101 5
6 0110 6
7 0111 7
8 1000 8
9 1001 9
A 1010 10
B 1011 11
C 1100 12
D 1101 13
E 1110 14
F 1111 15

So 0x2F becomes 0010 1111.

Why 4-bit grouping matters

Engineers reading an STM32, AVR or RISC-V reference manual expect registers in 4-bit groups. Grouping makes it obvious that 0x8001 has the MSB and LSB set and nothing in between.

Byte order and prefixes

  • 0x is a C-style hex prefix; &H is older BASIC; $ is used in 6502 assembly. The converter strips all three, and any other non-hex characters such as spaces, dashes or colons.
  • Binary output is always most-significant-bit first, network byte order. If your target is little-endian, swap the bytes before you lay them out.
  • Every hex digit always emits its full 4 bits, so a 32-bit register value always comes out as 32 bits. There is no leading-zero trimming to turn on or off.

Frequently Asked Questions

No. 0xFF, 0xff and 0xFf all convert to the same 11111111. The converter treats upper- and lower-case letters the same.

This converter works on the magnitude only: a leading - is a non-hex character, so it is removed and -0x01 converts to 0000 0001 just like 0x01. For two’s-complement or signed output, use a dedicated signed-number tool.

Yes. Separate them with spaces or newlines and the converter strips the separators: 2A 3B produces 0010 1010 0011 1011. Note the output is one continuous stream, so the boundaries between your input values are not preserved.

Yes. Every hex digit always emits its full 4 bits with leading zeros kept, so a 32-bit register value such as 0x80010000 comes out as 1000 0000 0000 0001 0000 0000 0000 0000, with byte boundaries always aligned.

Related Tools

Tool available in other languages