THE RIGHT TOOL FOR YOUR NEXT BYTE

Hex to Binary Converter

Enter a hexadecimal whole number such as 0x2A to see its binary value. Read the guide below for fixed-width groups and byte padding.

→
Runs locally
2 charactersWhole numbers · exact precision
Ready
Exact integer resultBase 2
Tip: enter a whole number in the selected input base.
Your data stays in your browser Free. No sign-up. Exact integer conversion
01 / EXPLAINED SIMPLY

How to convert hex to binary

Each hexadecimal digit maps to four bits. A group of four bits is called a nibble. For 2A, the digit 2 maps to 0010 and A maps to 1010. Together they form the byte 00101010.

The workbench shows the shortest binary representation of the integer. Enter 0x2A and it returns 101010.

Four-bit hexadecimal equivalents

Hex digit to four bits
Hexadecimal digitFour binary bits
00000
10001
20010
30011
40100
50101
60110
70111
81000
91001
A1010
B1011
C1100
D1101
E1110
F1111
Optional 0x prefix

Both 2A and 0x2A return 101010.

0x2A
Full 8-bit byte

Two F digits expand to eight ones: 11111111.

FF
Signed hex integer

Place a minus sign before the value or prefix to get -1010.

-0xA
02 / CONVERSION EXAMPLES

Keep complete bytes when the width matters

Two hex digits fill one byte. Pad a single byte on the left to eight bits when a file format or protocol requires it. For example, hex A has the numeric output 1010, and its eight-bit representation is 00001010.

Hexadecimal inputs with numeric and 8-bit padded binary outputs
Hex inputNumeric outputEight-bit representation
0x2A
10101000101010
0A
101000001010
FF
1111111111111111

To see these values in base 10, use Hex to Decimal. To read complete bytes as letters or other text, use Binary to Text with the source encoding.

GOOD QUESTIONS

Before you convert.

A few useful details for this tool.

Do I need to enter the 0x prefix?

The prefix is optional in Hexadecimal input. 2A and 0x2A both return 101010.

Why did the converter drop leading zeros?

The result is the shortest exact representation of a whole number. Pad it on the left to a fixed width when you need to preserve byte boundaries.

How do I fit an odd number of hex digits into bytes?

Add a leading zero to make the number of hex digits even. For example, A becomes the pair 0A, which represents the byte 00001010.

Can I convert signed hex numbers?

Yes. Place a minus sign before the value or prefix. For example, -0xA returns -1010 using a leading minus sign.