Hex to Binary Converter

0x and # prefixes, spaces, colons and underscores are all fine — paste a hex dump or a MAC address straight in.

Bit width

Every hex digit in binary

The sixteen hex digits, their decimal values, and the four bits each one stands for.
HexDecimalBinary
000000
110001
220010
330011
440100
550101
660110
770111
881000
991001
A101010
B111011
C121100
D131101
E141110
F151111

Learn these sixteen rows and you can convert any hex string in your head — that's the whole trick. Handles up to 1,024 hex digits, exactly, at any length.

Type hex, get binary. The answer updates as you type, and underneath it you get the part most converters leave out: the digit-by-digit working, so you can check the answer or learn the method rather than just borrowing it. Hex to binary is the easiest base conversion there is, because 16 is 2 to the fourth — every hex digit is exactly four bits, and the digits never affect each other. F5 is 1111 then 0101, and that's the whole conversion. Nothing to carry, no division, no arithmetic at all. That also means there is no precision limit here: a 64-character SHA-256 digest converts as exactly as FF does, where a converter that routed through a number type would start quietly rounding above 9 quadrillion. Paste a 0x literal, a colon-separated MAC address, a spaced hex dump or a plain string of digits — the prefix and the separators are stripped for you. Pick a bit width if you need the answer padded to a register size, and it pads on the left without ever dropping a significant bit. Everything runs in your browser: nothing is uploaded, nothing is stored, and there's no sign-up between you and the answer.

Built by Bob Article by Lace QA by Ben Shipped

How to use

  1. 1

    Type or paste the hex value. A 0x or # prefix is ignored, and spaces, colons, hyphens, commas and underscores are treated as separators — so 0xDEAD_BEEF, DE:AD:BE:EF and DE AD BE EF all read the same.

  2. 2

    Read the binary in the result card. Under it you get the same bits grouped in fours, the bit count, the version with leading zeros removed, and the exact decimal value.

  3. 3

    Pick a bit width if you need it padded to a register size — 8, 16, 32 or 64. It only ever adds zeros on the left; a value that needs more bits than you asked for keeps all of them and says so.

  4. 4

    Check the method in the working table: each hex digit sits beside the four bits it stands for. Read that column straight across and you have the answer.

  5. 5

    Tap Copy for the bare binary string, or Copy formula for the whole line with your input in it.

Frequently asked questions

Ratings & Reviews

Rate this tool

Sign in to leave a written review.
Loading reviews…

What is hex, and what is binary?

The Hex to Binary Converter turns a hexadecimal value into binary as you type. Paste 1A2B and you get 0001101000101011, grouped into fours as 0001 1010 0010 1011, with the digit-by-digit working underneath so you can check it or learn it rather than just borrow it. It runs in the browser tab you already have open. Nothing is uploaded, nothing is stored, and there's no account between you and the answer.

Hex and binary are two ways of writing the same number. Neither is more "computer" than the other — they're both notation, and the whole reason hex exists is to make binary readable by a person.

Binary

Binary is base 2. Two digits, 0 and 1, and each position is worth twice the one to its right: 1, 2, 4, 8, 16, and so on. 1011 is 8 + 0 + 2 + 1, which is 11. It's how hardware actually stores things, because a wire is either carrying current or it isn't. It's also miserable to read. One byte is eight bits — 11010110 — and you cannot glance at that and know what it says. Miscopy one character and you've changed the value by 128.

Hexadecimal

Hex is base 16. Sixteen digits: 0 through 9, then A for ten up to F for fifteen. That same byte, 11010110, is D6 in hex — two characters instead of eight, and you can still see the two halves it's built from. That's why memory dumps, colour codes, MAC addresses, hashes and error codes are all written in hex. The colour #1B6B45 is three bytes, one per channel, and you can read the red channel off the front without converting anything. Decimal can't do that, because its digit boundaries don't line up with the bits — 214 tells you nothing about which bits are set.

How hex to binary conversion works

This is the easiest base conversion there is, and it's worth knowing why: 16 is 2 to the fourth power. A hex digit holds sixteen possible values. Four bits hold exactly sixteen too, 0000 through 1111. The counts match perfectly, so the mapping is one-to-one with nothing left over.

One hex digit = four bits. Replace each digit with its four bits, write them in order, done. No carrying, no division, no arithmetic at all — the digits never affect each other.

Take 1A2B. Four digits, so four bits each, so sixteen bits out:

  1. 1 is one, which is 0001.
  2. A is ten, which is 1010.
  3. 2 is two, which is 0010.
  4. B is eleven, which is 1011.

Read straight across: 0001 1010 0010 1011, or 0001101000101011 written solid. That's the answer, and the decimal value is 6,699 if you want to check it another way. Notice that you never needed to know it was 6,699 to do the conversion. You worked on the characters, not on the number. The Hex to Binary Converter lays those four substitutions out in a table under the result, so the method is on screen next to the answer rather than hidden behind it.

Compare that to decimal. Ten isn't a power of two, so converting decimal to binary means repeated division and the digits all interact — you can't do it one digit at a time. That mismatch is the entire reason hex caught on. If you want the long way round for base 10, the decimal to binary converter shows that method instead.

The hex to binary table

Sixteen substitutions is the whole thing to memorise. Learn these rows and you can convert any hex string in your head, and use the Hex to Binary Converter to check yourself until you don't need to.

Every hex digit in binary

HexDecimalBinary
000000
110001
220010
330011
440100
550101
660110
770111
881000
991001
A101010
B111011
C121100
D131101
E141110
F151111

There's a pattern in there worth spotting. The top half, 0 to 7, all start with a 0. The bottom half, 8 to F, all start with a 1. So a hex digit of 8 or higher means the high bit of that nibble is set — which is exactly how you read "is this byte negative" off a signed value without doing any work.

Common hex to binary conversions

HexBinaryDecimalWhere you'd meet it
0A0000 101010The line-feed byte — a newline in a file
1F0001 111131Last of the ASCII control characters
450100 010169The letter E in ASCII
7F0111 1111127The biggest value seven bits can hold
801000 0000128Top bit set, nothing else — the sign bit in a signed byte
C31100 0011195A lead byte in UTF-8 text
FF1111 1111255Every bit set — one full byte, and the case everyone tests first
1A2B0001 1010 0010 10116,699Two bytes, the shape of a 16-bit register
CAFE1100 1010 1111 111051,966A file-format magic number, because it spells something
FFFF1111 1111 1111 111165,535A full 16-bit word
DEADBEEF1101 1110 1010 1101 1011 1110 1110 11113,735,928,559The classic debug filler value — 32 bits

The grouping in that middle column isn't decoration. Each group of four is one hex digit, which means you can read the table in either direction: cover the hex column and you've got a binary to hex chart instead. For the number rather than the bits, the hex to decimal converter does the base 10 side.

When you'll need to convert hex to binary

People land on a hex to binary converter for a handful of very specific reasons, and they're mostly not homework.

Reading a bitmask or a register. A datasheet says a status register came back C3 and bit 6 means "buffer full". C3 is 1100 0011, bit 6 counted from the right is a 1, and your buffer is full. You can't answer that question in hex — you have to see the bits. Once you're actually manipulating them, the bitwise operations calculator handles the AND, OR and shift side.

Permissions, flags and configuration. Feature flags packed into a single value, file permission bits, protocol headers: all of it is stored as hex and all of it means something one bit at a time.

Colour work. A hex colour is three bytes. Converting #1B6B45 gives 0001 1011 0110 1011 0100 0101 — twenty-four bits, eight per channel. That's more use for understanding how the format is built than for picking a shade, which is what the hex to RGB converter is for.

Coursework. Base conversion is on every computer-architecture syllabus, and this is the one where showing your working is the entire mark. The per-digit table on this page is the working, laid out the way a marker wants to see it.

Where hex to binary conversion trips people up

If your answer doesn't match the one you were expecting, it's almost always one of three things. Here's what to check first.

Leading zeros. Is 0A equal to 1010 or 00001010? Both, for different questions. Read as a number, 0A is ten, and ten in binary is 1010 — the leading zero carries no value, same as the one in 007. Read as two hex digits, which is how a byte in a register dump is written, it's 00001010, and the width is the point: it tells you this is one byte. The Hex to Binary Converter shows you both, because picking one would be wrong for half the people asking.

Negatives. Type -1A and you get -00011010: the binary of 1A with a minus in front. That's sign-magnitude, and it's the plain mathematical answer your textbook wants. Computers store negatives as two's complement instead, where -26 is 11100110 in 8 bits and 1111111111100110 in 16. Notice there's no single right answer until you pick a width — which is why two's complement lives in a tool where you choose one, rather than here.

Grouping from the wrong end. Going back from binary to hex, you split into fours starting from the right. 110100011 splits as 1, 1010, 0011; pad the short group on the left to get 0001 1010 0011, which reads as 1A3. Group from the left instead and every place value shifts.

A typo that looks like a bug: capital O is not zero and lowercase l is not one. Neither is a hex digit, so the converter stops and says which character it choked on rather than guessing. Same with a 0b prefix — that's binary already, and 0b1010 happens to be valid hex too, so silently converting it would hand you a confidently wrong answer.

One more thing worth knowing, because it isn't universal: this conversion is a per-digit substitution, so there's no number type in the path and no precision ceiling. A 64-character SHA-256 digest converts bit-for-bit correctly, as does a 1,024-digit RSA modulus. Converters built on a plain JavaScript number start quietly rounding above 9,007,199,254,740,991 — roughly sixteen hex digits — and they don't tend to mention it. The only limit here is a page one: 1,024 hex digits, past which the working table has more rows than anyone reads.

Related converters

Hex and binary are two corners of the same small map, and the rest of it is here too. Going the other way from base 10, the decimal to binary converter does the repeated-division method with the steps shown, and binary to decimal adds up the place values for you. For arbitrary pairs of bases — base 3, base 36, anything — the number base converter covers all of them at once.

If your hex is a colour rather than a number, hex to RGB and the color converter are the right stops. And if you're converting words rather than values, text to binary turns characters into their byte values first.

Every one of these works the same way: open it, do the thing, close the tab. No account, no per-seat pricing for a lookup table, no fourteen-day countdown on arithmetic that was settled in the 1960s.

Frequently asked questions

Is hex to binary conversion exact, or is it rounded?

Exact, always, at any length. Because each hex digit maps to a fixed group of four bits, nothing is calculated and nothing can drift. A 64-digit hash is as exact as FF. This is unusual for a converter — most conversions involve arithmetic somewhere, and arithmetic is where precision goes missing. Here there is none.

Why does my answer have more bits than I expected?

The default width is four bits per hex digit, so 0A comes back as eight bits and 1A2B as sixteen. That keeps the per-digit working lined up underneath. If you want the value with the leading zeros stripped, it's shown on the line below the main answer — 1A2B is 13 significant bits, 1101000101011. If you want it padded out to a register instead, pick 8, 16, 32 or 64 from the bit width control. That padding is a floor, never a trim: ask for 8 bits of FFFF and you still get all sixteen, plus a note saying it didn't fit. Truncating would return a different number while looking like a formatting choice.

Can I paste a hex colour code or a MAC address straight in?

Yes. A # or 0x prefix is stripped, and spaces, colons, hyphens, commas and underscores are all treated as separators. So #1B6B45, 0xDEAD_BEEF, DE:AD:BE:EF and a spaced hex dump all read correctly without you cleaning them up first. 0xDEAD_BEEF and DE:AD:BE:EF give the same 32 bits, because they're the same four bytes written two ways.

What is a nibble?

Four bits — half a byte, and exactly one hex digit. It's a real term, not a joke, though the joke is clearly why it stuck. It's the reason the answer is displayed in groups of four: each group is one nibble, which is one hex digit, which makes converting back a lookup instead of a calculation.

Should I write 0b in front of the binary answer?

Only if you're pasting it into code. 0b is a source-code prefix that tells C, Python, Rust and JavaScript to read the following digits as base 2 — it isn't part of the number, the same way 0x isn't part of a hex value. The answer here comes back as bare digits so you can paste it anywhere, and you add the prefix yourself if the language you're writing in wants one.

Is hex to binary the same as hex to decimal?

No, and the difference is bigger than it looks. Hex to binary is a substitution you can do digit by digit with no arithmetic. Hex to decimal needs real multiplication, because 10 isn't a power of 2 and the digit boundaries don't line up. FF is 11111111 in binary, which you can read straight off the table, but it's 255 in decimal, which you have to work out. The exact decimal value is shown here too, under the binary answer, for values short enough to be worth reading as a number.

Is there a limit on how many conversions I can do?

No limit, no sign-up, no queue. The Hex to Binary Converter runs entirely in your browser, which is why it's instant and why it keeps working if your connection drops mid-session. That matters more here than on most converters, because the things people paste into a hex tool are often keys, hashes and device addresses — none of it goes anywhere. Microapp is paid for by memberships and ads rather than by metering the tools, and 10% of every dollar it earns goes to charity, off the top, audited quarterly.