The four bases side by side
| Decimal | Binary | Octal | Hex |
|---|---|---|---|
| 0 | 0000 | 0 | 0 |
| 7 | 0111 | 7 | 7 |
| 8 | 1000 | 10 | 8 |
| 10 | 1010 | 12 | A |
| 15 | 1111 | 17 | F |
| 16 | 1 0000 | 20 | 10 |
| 255 | 1111 1111 | 377 | FF |
| 65,535 | 1111 1111 1111 1111 | 177777 | FFFF |
One hex digit is exactly four binary digits, which is why the binary output is shown in groups of four. One octal digit is three binary digits.
How the input is read
- With “Detect”, a number starting with
0xis hex,0bis binary and0ois octal. A number containing the letters A to F is read as hex. Anything else is decimal. - Choose the input base yourself when the digits are ambiguous.
1010is ten in binary and one thousand and ten in decimal. - Spaces, commas and underscores are ignored, so
1111_0000and1,000,000both work.
Questions
Is there a size limit?
No practical one. The page uses arbitrary-precision integers, so a 64-bit value such as 18,446,744,073,709,551,615 or a 256-bit hash converts exactly.
How are negative numbers shown?
With a minus sign in every base. Two's-complement bit patterns depend on a fixed width, which this page does not assume.
Does it convert fractions?
No, whole numbers only.