How to convert
- Each hexadecimal digit is exactly 4 binary digits, so convert by grouping — no decimal step needed.
- Split the bits into groups of 4 from the right, pad the left group with zeros, and replace each group. Example: 101101 → 0010 1101 → 2D.
Notes
- Integers of any length are converted exactly — no scientific notation.
- Prefixes are accepted: 0x for hex, 0b for binary, 0o for octal; spaces and underscores are ignored.
- Negative numbers: prefix with "-". Fractions are not supported yet.
Binary to Hex table
| Binary | Hex | Decimal |
|---|---|---|
| 0 | 0 | 0 |
| 1 | 1 | 1 |
| 10 | 2 | 2 |
| 11 | 3 | 3 |
| 100 | 4 | 4 |
| 101 | 5 | 5 |
| 110 | 6 | 6 |
| 111 | 7 | 7 |
| 1000 | 8 | 8 |
| 1001 | 9 | 9 |
| 1010 | A | 10 |
| 1011 | B | 11 |
| 1100 | C | 12 |
| 1101 | D | 13 |
| 1110 | E | 14 |
| 1111 | F | 15 |
| 1 0000 | 10 | 16 |
| 10 0000 | 20 | 32 |
| 100 0000 | 40 | 64 |
| 110 0100 | 64 | 100 |
| 111 1111 | 7F | 127 |
| 1000 0000 | 80 | 128 |
| 1111 1111 | FF | 255 |
| 1 0000 0000 | 100 | 256 |
| 11 1110 1000 | 3E8 | 1000 |
| 100 0000 0000 | 400 | 1024 |
| 1 0000 0000 0000 | 1000 | 4096 |
| 1111 1111 1111 1111 | FFFF | 65535 |