How it works
Binary counts in base 2, hexadecimal counts in base 16. Converting means rewriting the same quantity with a different set of digits — the value never changes, only how it is written.
- Convert each binary digit to its decimal value and add them up.
- Divide that total by 16, keeping the remainders.
- Read the remainders bottom to top for the hexadecimal result.
Shortcut: group the binary digits in fours from the right and replace each group with one hexadecimal digit — 1010 becomes A, 1111 becomes F.
The reverse conversion is the number converter, which also handles every other base pair.
Examples
Worked examples, digit by digit:
- 101010 (binary) = 42 in decimal = 2A (hexadecimal)
- 1010101 (binary) = 85 in decimal = 55 (hexadecimal)
- 11111111 (binary) = 255 in decimal = FF (hexadecimal)
| Decimal | Binary | Octal | Hexadecimal |
|---|---|---|---|
| 0 | 0 | 0 | 0 |
| 1 | 1 | 1 | 1 |
| 2 | 10 | 2 | 2 |
| 4 | 100 | 4 | 4 |
| 8 | 1000 | 10 | 8 |
| 10 | 1010 | 12 | A |
| 15 | 1111 | 17 | F |
| 16 | 10000 | 20 | 10 |
| 32 | 100000 | 40 | 20 |
| 64 | 1000000 | 100 | 40 |
| 100 | 1100100 | 144 | 64 |
| 255 | 11111111 | 377 | FF |
Binary to Hexadecimal: frequently asked questions
- How do I convert binary to hexadecimal?
- Group the binary digits in fours from the right and convert each group to one hex digit (0–9, A–F). For example, binary 101101 is 2D in hexadecimal. The converter above does this instantly for any value.
- What is 11111111 in hexadecimal?
- Binary 11111111 equals FF in hexadecimal (the value 255, the largest number that fits in one byte).
- Why are binary and hexadecimal used?
- Binary (base 2) is how computers store data, as bits that are either 0 or 1. Hexadecimal (base 16) writes each byte as two characters.
