What it does
The Number Base Converter converts whole numbers between binary, octal, decimal and hexadecimal. Type in any field and the others update straight away. It handles numbers of any size, negative numbers, and shows how many bits the value needs.
How to use it
- Type a number into the field for its base: Binary (2), Octal (8), Decimal (10) or Hexadecimal (16).
- Read the same value in the other bases and copy the one you need.
Underscores and spaces are ignored, so 1111_0000 and ff ff work. Use a leading - for negative numbers.
Examples
| Decimal | Binary | Octal | Hex |
|---|---|---|---|
| 255 | 11111111 | 377 | ff |
| 2026 | 11111101010 | 3752 | 7ea |
255 needs 8 bits, which is why it is the largest value in one byte.
Good to know
- Hexadecimal uses digits 0–9 and letters a–f, where a is 10 and f is 15. Each hex digit is exactly 4 bits.
- Values are exact for any size (BigInt), so 64-bit IDs and large hashes convert without rounding.
- Negative numbers are shown with a minus sign, not as two's complement.
FAQ
How do I convert a colour like #4f46e5? Use the Color Converter, which turns hex colours into RGB, HSL and more.
Can it convert fractions? No, whole numbers only.