Binary to Hex Converter
To convert binary to hexadecimal, split the bits into groups of four starting from the right and replace each group with one hex digit (0-9, A-F). Enter binary below to see the grouping and the hex result.
Hexadecimal result
CA
Decimal value of the input: 202
Working
- Split into groups of 4 bits; each group is one hex digit (0-9, A-F).
- 1100 = 12 = C
- 1010 = 10 = A
- Join the digits: CA.
Example: 11001010 to hex
- Split into groups of 4 bits; each group is one hex digit (0-9, A-F).
- 1100 = 12 = C
- 1010 = 10 = A
- Join the digits: CA.
- Result: CA (decimal 202)
Why groups of four
Hexadecimal is base 16, and 16 is 2 to the power 4. That means exactly four binary digits map to exactly one hex digit, with no arithmetic across groups. The group 0000 is 0, 1001 is 9, 1010 is A and 1111 is F.
If the number of bits is not a multiple of 4, add leading zeros on the left until it is. The working below the converter shows the padding it applied. For example, 101 becomes 0101 before it is read as a single group, so its hex digit is 5 and not a longer string.
Where you see hex
Hex is a compact way to write bytes: one byte is exactly two hex digits. You will see it in colour codes, memory addresses, MAC addresses, hash digests and in the hex column of the ASCII table. Hex is a notation for the same bits, not a different number, which is why conversion never changes the value. Because a leading group of zeros is a real digit, the tool keeps it: 00001111 becomes 0F, which is the usual way to write a byte.
Cross-check with decimal
The tool also reports the decimal value of the input. If you convert the hex result back with the hex to binary converter you get the same bits, possibly with the padding zeros that the grouping added.
Frequently asked questions
- What is 1111 in hex?
- F, because 1111 is 15 in decimal and hex uses A-F for 10-15.
- Does the tool keep leading zeros?
- Yes, in full groups of four. 00001111 gives 0F; 1111 gives F.
- Why do programmers prefer hex to binary?
- It is four times shorter and still maps cleanly onto bits, so it is easier to read and copy without mistakes.
- Is the hex output uppercase?
- Yes. Hex digits are case-insensitive in value, so a to f mean the same as A to F.