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 digit
Four binary bits
0
0000
1
0001
2
0010
3
0011
4
0100
5
0101
6
0110
7
0111
8
1000
9
1001
A
1010
B
1011
C
1100
D
1101
E
1110
F
1111
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 input
Numeric output
Eight-bit representation
0x2A
101010
00101010
0A
1010
00001010
FF
11111111
11111111
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.