How to convert Binary to Hexadecimal
Binary and hexadecimal line up perfectly: every group of 4 bits is exactly one hexadecimal digit. Pad the binary number with leading zeros to a multiple of 4, split it into groups of 4 starting from the right, and translate each group using the table below.
Worked example
Convert 101101 (binary) to hexadecimal:
- Start with binary
101101; pad to a multiple of 4 bits:0010 1101 0010→21101→D- Result:
2D
So 101101 in binary is 2D in hexadecimal.
Binary to Hexadecimal conversion table
| Binary | Hexadecimal |
|---|---|
| 0 | 0 |
| 1 | 1 |
| 10 | 2 |
| 11 | 3 |
| 100 | 4 |
| 101 | 5 |
| 110 | 6 |
| 111 | 7 |
| 1000 | 8 |
| 1001 | 9 |
| 1010 | A |
| 1011 | B |
| 1100 | C |
| 1101 | D |
| 1110 | E |
| 1111 | F |
Frequently asked questions
- Can this handle numbers larger than 64 bits?
- Yes. Conversion runs on arbitrary-precision integers, so numbers of any length convert exactly. Many online converters silently lose precision above 2⁵³ (about 16 decimal digits) — this one doesn't.
- How do I convert negative numbers?
- A leading minus sign works in every base. For the bit-pattern view programmers usually want, switch the mode to two's complement at 8, 16, 32, or 64 bits — then binary, octal, and hex show the bit pattern while decimal shows the signed value.
- Can I convert the other way, or to other bases?
- Use the Hexadecimal to Binary converter, or just change the From/To dropdowns above — every common base is shown at once anyway, and a Text mode converts ASCII to bytes and back.
Need arithmetic rather than conversion — adding hex numbers, shifting bits, masking? Use the programmer's calculator.