0xCONVERTER-HEX

Base 16 → base 2

Hex to Binary Converter

Expand hexadecimal into bits. One digit in, four bits out — no arithmetic required.

Hexadecimal in

Binary

Decimal

How to convert hex to binary

This is the easiest conversion in the set, because it needs no division and no multiplication. Replace each hex digit with its four-bit pattern and join the results in order. That is the whole method.

  1. Take the leftmost hex digit.
  2. Write its four-bit pattern, including any leading zeros.
  3. Move right and do the same for every remaining digit.
  4. Concatenate the groups in the order you produced them. No reversing, no carrying.

The shortcut, and why it exists

Sixteen is 24. That single fact makes hex and binary interchangeable at the digit level: each hex digit covers exactly four bit positions and the groups never interfere. Base 10 has no such relationship with base 2, which is why converting decimal to binary needs real arithmetic and this does not.

Memorise sixteen patterns, convert anything

You do not need to learn 256 byte values. Learn the sixteen nibble patterns below and you can expand any hex string of any length at reading speed.

HexDecimalBinaryOctal
0000000
1100011
2200102
3300113
4401004
5501015
6601106
7701117
88100010
99100111
A10101012
B11101113
C12110014
D13110115
E14111016
F15111117

Worked examples

C0DE

  C → 1100
  0 → 0000
  D → 1101
  E → 1110

  joined → 1100 0000 1101 1110


3F

  3 → 0011
  F → 1111

  joined → 0011 1111


A9

  A → 1010
  9 → 1001

  joined → 1010 1001

Leading zeros are not optional

This is where hand conversions go wrong. Inside a multi-digit number every hex digit must contribute four bits, even when its pattern begins with zeros. Dropping them shifts everything to the right and produces a different number.

correct    C0DE → 1100 0000 1101 1110   (16 bits)
wrong      C0DE → 1100 0    1101 1110   (13 bits, wrong value)

The only zero that can legitimately disappear is at the very front of the whole number, where it changes nothing — the same way 007 and 7 are equal in decimal.

Grouping, and reading bits like an engineer

An unbroken run of bits is technically correct and practically unreadable. The chips switch between two conventions that answer different questions.

  • Nibbles — groups of four, aligned with the hex digits. Use this to check a conversion or trace a hex digit into the bit pattern.
  • Bytes — groups of eight, aligned with memory. Use this when you care about storage, protocol fields or how a value sits in registers.
  • Unbroken — no separators, for pasting into code or a field that rejects spaces.

Bit widths worth recognising

Hex digitsBitsTypically
14A nibble — one mask, one flag group
28One byte — a character, a color channel
416A word — a port number, a UTF-16 code unit
624An RGB color
832An IPv4 address, a 32-bit register
1664A 64-bit integer or pointer
32128A UUID, an AES key, an IPv6 address
64256A SHA-256 hash

Counting hex characters is the fastest way to identify what you are looking at. Thirty-two characters is almost certainly a UUID or an MD5 digest; sixty-four is almost certainly SHA-256.

To practise the substitution without a tool, see converting hex to binary by hand. For why both notations exist at all, see hex versus binary, and for every byte written out, the hex to binary table.

Frequently asked questions

How do I convert hex to binary quickly?

Replace each hex digit with its four-bit pattern and join them in order. No arithmetic is needed because 16 is 2 to the power of 4.

What is F in binary?

1111. F is 15 in decimal, which sets all four bits of a nibble.

What is C0DE in binary?

1100 0000 1101 1110. C is 1100, 0 is 0000, D is 1101 and E is 1110.

Why must I keep the leading zeros?

Each hex digit occupies four bit positions. Dropping a zero shifts every bit to its right and changes the value. Only zeros at the very front of the number are free to omit.

How many bits is one hex digit?

Exactly four, which is called a nibble. Two hex digits make one eight-bit byte.

Should I group bits in fours or eights?

Fours line up with the hex digits and make a conversion easy to verify. Eights line up with bytes and make memory layout easier to read.