ToolNimba

๐Ÿ”ฃ Hex to Binary Converter with Steps

Shihab Mia By Shihab Mia ยท Updated 2026-07-27

Spaces and an optional 0x prefix are ignored. Digits 0-9 and A-F are allowed.

Binary value
11111111
Nibble groups (4 bits per hex digit)
1111 1111
Bit count
8
Decimal (base 10)
255
Octal (base 8)
377
Hex digits
FF
Each hex digit mapped to its 4-bit binary nibble
Hex digit Decimal 4-bit binary

This hex to binary converter turns any hexadecimal number into its binary value in one step, so FF becomes 11111111 and 1A becomes 11010. It shows the raw binary, a nibble-grouped form where each hex digit maps to its own 4 bits (FF becomes 1111 1111), the bit count, and the matching decimal and octal values. Everything runs in your browser, and it stays exact for very long hex strings using BigInt, well past the 8 or 32 bits most examples stop at.

What is the Hex to Binary Converter?

Hexadecimal, or hex, is a base 16 number system that uses sixteen symbols: the digits 0 through 9 and then the letters A, B, C, D, E and F to stand for the values 10 through 15. Binary is base 2 and uses only 0 and 1. The two systems fit together neatly because 16 is 2 to the power 4, which means every single hex digit maps to exactly four binary digits, a group known as a nibble. That clean four-to-one relationship is why hex is used so often as a short, readable stand-in for long binary strings in colors, memory addresses and byte dumps.

To convert hex to binary by hand you do not need to touch decimal at all. Take the hex value one digit at a time, left to right, and replace each digit with its fixed 4-bit binary pattern. The digit F is 1111, the digit A is 1010, the digit 1 is 0001, and so on. Write those nibbles side by side in the same order and you have the binary result. For the hex number FF, the first F becomes 1111 and the second F becomes 1111, giving the nibble form 1111 1111, which is 11111111 as a raw binary string equal to 255 in decimal.

The converter above shows both forms on purpose. The nibble-grouped view keeps every hex digit aligned to its own 4 bits, which makes it easy to spot which digit produced which bits and to catch a typo. The raw binary form simply drops the leading zeros of the most significant nibble so the number reads naturally: hex 1A expands to 0001 1010 as nibbles, but its raw binary is 11010 because the leading three zeros are not written. Both represent the same value, 26 in decimal.

Conversion gets a layer more complex when a hex value represents a signed number rather than a plain positive count. Most systems use two's complement to represent negative integers: flip every bit of the positive binary value and add 1. In an 8-bit byte, the hex value FF is 11111111 as an unsigned pattern, worth 255, but read as a signed two's complement byte that same bit pattern represents -1, and 80 (10000000) represents -128 rather than 128. The bits themselves never change, only how you choose to interpret them, so always check whether a hex value on a datasheet or in code is meant to be signed before assuming it is a plain positive count.

The digit-for-nibble method also works past the decimal point, in what is called a hex point. A fractional hex digit converts to a nibble the same way an integer digit does, so hex 0.8 becomes binary 0.1000 and hex 0.C becomes binary 0.1100, though this comes up far less often than whole-number conversions. Hex to binary also shows up constantly in everyday computing without anyone naming it: a CSS color such as #FF5733 is really three hex bytes, FF, 57 and 33, each expanding to 8 bits of red, green and blue intensity; a subnet mask like 0xFFFFFF00 is 24 straight 1 bits followed by 8 zero bits; and languages from C to Python to JavaScript accept the 0x prefix directly in source code because the compiler performs this same hex-to-binary expansion before the program ever runs.

Internally the tool parses the hex with BigInt, so the decimal, octal and binary results stay exact no matter how many digits you paste. Standard JavaScript number math is only reliable up to 53 bits, and a long hexadecimal value such as a 64-bit register or a hash fragment would quietly lose precision with a plain parseInt. Using BigInt means a 16-digit hex string, which is 64 bits, still converts to the true binary and decimal value rather than a rounded approximation.

When to use it

  • Expanding a hex color, byte, or flag such as FF or C0 into its exact binary bit pattern.
  • Checking a homework or exam answer when converting a hexadecimal number to binary by hand.
  • Reading a memory address or register value from a debugger and seeing the underlying bits.
  • Cross checking a hex value against its binary, decimal and octal forms while working on low level code.
  • Decoding a CSS or design hex color code such as #1A2B3C into its raw red, green, and blue bit pattern.
  • Working out a subnet mask or other networking hex value in its binary form for routing and firewall work.

How to use the Hex to Binary Converter

  1. Type or paste a hex number (0-9 and A-F, with an optional 0x prefix) into the input box, or tap an example button.
  2. Read the binary value at the top; it updates instantly as you type.
  3. Check the nibble groups line to see how each hex digit maps to its own 4 bits.
  4. Use the copy buttons to grab the binary, nibble, decimal, or octal result for use elsewhere.

Formula & method

Convert each hex digit to its 4-bit binary nibble and concatenate the nibbles in order. Digit d with decimal value v (0 to 15) becomes the 4-bit form of v, so F (15) is 1111 and A (10) is 1010. For example FF becomes 1111 followed by 1111, that is 1111 1111, and dropping leading zeros gives the raw binary 11111111. Equivalently, binary = value.toString(2) where value = the number written 0xhex.
Hex FF to BinaryFF11111111nibblenibble= 11111111

Worked examples

Convert the hex number FF to binary.

  1. Split the hex into single digits: F and F.
  2. Replace the first F with its 4-bit nibble 1111.
  3. Replace the second F with its 4-bit nibble 1111.
  4. Join the nibbles in order: 1111 1111.
  5. Drop leading zeros for the raw form (there are none here): 11111111.

Result: FF in hex equals 11111111 in binary (nibbles 1111 1111), which is 255 in decimal and 377 in octal.

Convert the hex number 1A to binary.

  1. Split the hex into single digits: 1 and A.
  2. Replace 1 with its nibble 0001.
  3. Replace A (decimal 10) with its nibble 1010.
  4. Join the nibbles: 0001 1010.
  5. Drop the leading zeros of the first nibble for the raw form: 11010.

Result: 1A in hex equals 11010 in binary (nibbles 0001 1010), which is 26 in decimal and 32 in octal.

Convert the hex number 3E8 to binary.

  1. Split the hex into single digits: 3, E, and 8.
  2. Replace 3 with its nibble 0011.
  3. Replace E (decimal 14) with its nibble 1110.
  4. Replace 8 with its nibble 1000.
  5. Join the nibbles: 0011 1110 1000.
  6. Drop the two leading zeros of the first nibble for the raw form: 1111101000.

Result: 3E8 in hex equals 1111101000 in binary, which is 1000 in decimal and 1750 in octal, a value often seen in networking and port number examples.

Every hex digit with its decimal value and 4-bit binary nibble

HexDecimalBinary (4-bit)
000000
110001
220010
330011
440100
550101
660110
770111
881000
991001
A101010
B111011
C121100
D131101
E141110
F151111

Common hex values with their binary, decimal, and octal equivalents

HexBinaryDecimalOctal
1111
81000810
A10101012
F11111517
10100001620
1A110102632
8010000000128200
FF11111111255377
100100000000256400
C0FFEE1100000011111111111011101264843060177756

Signed 8-bit (byte) reference: the same bits read as unsigned versus two's complement

HexBinaryUnsigned decimalSigned (two's complement)
000000000000
0F000011111515
7F01111111127127
8010000000128-128
C011000000192-64
F011110000240-16
FF11111111255-1

Common mistakes to avoid

  • Padding the raw binary with extra leading zeros. The nibble form of 1A is 0001 1010, but the raw binary number is 11010, not 00011010. Leading zeros on the most significant nibble are not part of the value. Keep them only when you deliberately want a fixed width such as a full byte.
  • Dropping leading zeros inside the number. Every hex digit except the first must expand to a full 4 bits. The 0 in hex A0 becomes 0000, so A0 is 1010 0000, not 1010 0. Skipping those interior zeros shifts and shrinks the value.
  • Treating the letters as their alphabet position. In hex A is 10, B is 11, up to F which is 15. It is not the 1st or 6th letter of the alphabet. Convert the letter to its value 10 to 15 first, then to its 4-bit nibble.
  • Assuming plain number math stays exact for long hex. Standard JavaScript numbers lose precision beyond 53 bits, so a long hexadecimal to binary conversion can drift. This tool uses BigInt so the binary and decimal results stay exact for any length you enter.
  • Reading a signed byte as if it were plain unsigned. The bit pattern 11111111 is 255 if you assume unsigned, but -1 in two's complement signed form. Check whether the spec or code you are reading treats the value as signed before deciding what the bits mean.
  • Converting a fractional hex point value the wrong way. Digits after a hex point still expand to 4-bit nibbles just like whole-number digits, so hex 0.8 is binary 0.1000, not 0.8 or 0.08. Treat the fractional part digit by digit exactly like the integer part.

Glossary

Hexadecimal
A base 16 number system using the digits 0 to 9 and the letters A to F, where A to F stand for the values 10 to 15.
Binary
A base 2 number system that uses only the digits 0 and 1, where each position is worth twice the position to its right.
Nibble
A group of 4 bits. One hex digit maps to exactly one nibble, which is why hex is a compact shorthand for binary.
Bit
A single binary digit, either 0 or 1. It is the smallest unit of data in computing.
0x prefix
A marker written in front of a number to show it is hexadecimal, as in 0xFF. It is not part of the value and is stripped before conversion.
Most significant nibble
The leftmost hex digit and its 4 bits, which carry the largest place value in the number.
Two's complement
The standard way computers represent negative numbers in binary: flip every bit of the positive value and add 1.
Byte
A group of 8 bits, equal to exactly two hex digits or two nibbles side by side.

Frequently asked questions

How do you convert hex to binary?

To convert hex to binary, replace each hexadecimal digit with its fixed 4-bit binary pattern and join them in order. For example F is 1111, so FF becomes 1111 1111, which is 11111111 as a raw binary number.

What is FF in binary?

Hex FF equals 11111111 in binary. Each F maps to the nibble 1111, so the two digits give 1111 1111, which is 255 in decimal and the largest value a single byte can hold.

What is 1A in binary?

Hex 1A equals 11010 in binary. The digit 1 is the nibble 0001 and A is 1010, giving 0001 1010, and dropping the leading zeros leaves 11010, which is 26 in decimal.

What is 3E8 in binary?

Hex 3E8 equals 1111101000 in binary. The digit 3 is nibble 0011, E is 1110, and 8 is 1000, and dropping the leading zeros of the first nibble gives 1111101000, which is 1000 in decimal.

Why does each hex digit become exactly 4 bits?

Because 16 is 2 to the power 4, so one base 16 digit carries exactly the same information as four base 2 digits. That is why every hex digit maps cleanly to a 4-bit nibble.

Do I need to remove the 0x prefix first?

No. This converter automatically strips an optional 0x or 0X prefix and any spaces before converting, so both 0xFF and FF give the same binary result.

Can this converter handle very long hex numbers?

Yes. This hex to binary converter uses BigInt internally, so it keeps the binary and decimal results exact for hex strings well beyond 53 bits, unlike simple calculators that round large values.

How do you convert a negative hex number to binary?

A negative hex value is usually stored as a signed two's complement bit pattern rather than a minus sign plus a positive value. Convert the hex digits to binary as normal first, then read the result as unsigned or as two's complement signed depending on what the byte width and spec call for.

What is the binary for a hex color code like FF5733?

A CSS hex color splits into three bytes: FF, 57, and 33 for red, green, and blue. Each byte converts on its own, so FF5733 in binary is 11111111 01010111 00110011, one 8-bit value per color channel.

Can I convert hex to binary without a calculator or chart?

Yes. Memorize that A through F are 10 through 15, then write each digit as its 4-bit nibble from memory: for example 9 is 1001 and C is 1100. With practice this digit-by-digit method is faster than converting through decimal.