How to use the binary to hex converter
- 1Paste the binary into Binary (base 2). Spaces between groups are ignored.
- 2Read the result in Hexadecimal (base 16). Decimal and octal appear under Other bases.
- 3Tick Keep leading zeros to keep the full width (
00001111→0Frather thanF). - 4Open Step-by-step working to see each 4-bit group and its hex digit, then press Copy.
Example
1101011
Hexadecimal: 6B Decimal: 107 Octal: 153
Padded to 0110 1011: 0110 = 6 and 1011 = B.
Grouping bits into nibbles
Sixteen is 2⁴, so every hex digit stands for exactly four bits (a nibble). To convert:
- Split the binary into groups of four starting from the right.
- Pad the leftmost group with zeros if it is short.
- Replace each group with its hex digit.
1101011 → 0110 1011 → 6B. There is no arithmetic beyond the 16-row table below, which is why programmers read hex as shorthand for binary.
Binary-hex reference table
| Hex | Binary | Decimal | Hex | Binary | Decimal |
|---|---|---|---|---|---|
| 0 | 0000 | 0 | 8 | 1000 | 8 |
| 1 | 0001 | 1 | 9 | 1001 | 9 |
| 2 | 0010 | 2 | A | 1010 | 10 |
| 3 | 0011 | 3 | B | 1011 | 11 |
| 4 | 0100 | 4 | C | 1100 | 12 |
| 5 | 0101 | 5 | D | 1101 | 13 |
| 6 | 0110 | 6 | E | 1110 | 14 |
| 7 | 0111 | 7 | F | 1111 | 15 |
Padding and leading zeros
Leading zeros don't change a number's value: 00001111 and 1111 are both F. They do matter when the width is meaningful, such as a byte in a file or a register value. Tick Keep leading zeros and the hex result keeps one digit for every four bits you typed (00001111 → 0F, 0000000011111111 → 00FF).
Group from the right, never from the left: grouping 1101011 from the left as 1101 011 would give the wrong answer.
Hex in programming and colours
Hex appears wherever bytes are shown to people: 0xFF in code, %20 in URLs, MAC addresses (3C:22:FB:…), file signatures (PNG files start 89 50 4E 47) and web colours. A colour such as #FF5722 is three bytes, red FF, green 57, blue 22. The RGB to HEX converter converts those to decimal channel values.
Is my text private?
This tool runs entirely in your browser. Your text is not uploaded to our servers.
