How to use it
Type a number and pick its base. Binary, octal, decimal and hexadecimal appear at once, and "N for base N" adds any base from 2 to 36. Prefixes such as 0x1F and 0b1010 and separators such as 1111_0000 or FF FF are accepted. Numbers of any length are converted exactly.
Quick reference
| Decimal | Binary | Octal | Hex |
|---|---|---|---|
| 7 | 111 | 7 | 7 |
| 10 | 1010 | 12 | A |
| 15 | 1111 | 17 | F |
| 16 | 10000 | 20 | 10 |
| 100 | 1100100 | 144 | 64 |
| 255 | 11111111 | 377 | FF |
| 1024 | 10000000000 | 2000 | 400 |
| 65535 | 1111111111111111 | 177777 | FFFF |
Two's complement
Choose a bit width (8, 16, 32 or 64) and enter a negative number to see its two's-complement bit pattern: −1 is 11111111 (FF) in 8 bits and −128 is 10000000 (80). Enter a positive number with a bit width to see the pattern read as a signed value: FF is 255 unsigned but −1 as a signed 8-bit value.
Frequently asked questions
Can it convert fractions such as 0.1?
No, integers only. Decimal 0.1 has no finite binary representation.
Is my input sent anywhere?
No. Everything is calculated in your browser.