How to convert
- Each hexadecimal digit is exactly 4 binary digits, so convert by grouping — no decimal step needed.
- Replace each digit with its 4-bit pattern and drop leading zeros. Example: 2D → 0010 1101 → 101101.
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.
Hex to Binary table
| Hex | Binary | Decimal |
|---|---|---|
| 0 | 0 | 0 |
| 1 | 1 | 1 |
| 2 | 10 | 2 |
| 3 | 11 | 3 |
| 4 | 100 | 4 |
| 5 | 101 | 5 |
| 6 | 110 | 6 |
| 7 | 111 | 7 |
| 8 | 1000 | 8 |
| 9 | 1001 | 9 |
| A | 1010 | 10 |
| B | 1011 | 11 |
| C | 1100 | 12 |
| D | 1101 | 13 |
| E | 1110 | 14 |
| F | 1111 | 15 |
| 10 | 1 0000 | 16 |
| 20 | 10 0000 | 32 |
| 40 | 100 0000 | 64 |
| 64 | 110 0100 | 100 |
| 7F | 111 1111 | 127 |
| 80 | 1000 0000 | 128 |
| FF | 1111 1111 | 255 |
| 100 | 1 0000 0000 | 256 |
| 3E8 | 11 1110 1000 | 1000 |
| 400 | 100 0000 0000 | 1024 |
| 1000 | 1 0000 0000 0000 | 4096 |
| FFFF | 1111 1111 1111 1111 | 65535 |