About the Number Base Converter
Type a number into any field and all the others update instantly. The converter shows the bases you need most in programming, computer science and electronics – binary (BIN), octal (OCT), decimal (DEC) and hexadecimal (HEX) – and the lower box lets you pick any base from 2 to 36.
It uses exact arbitrary-precision integers (BigInt), so numbers like 2⁶⁴ convert without rounding errors, and negative numbers also show their two’s complement representation.
How to use
- Type a number into the field for the base you know. The other fields update automatically.
- Prefixes 0x (hex), 0b (binary) and 0o (octal) are accepted; spaces and _ separators are ignored.
- For other bases, choose 2–36 under Any base and type the value there.
- Use the Copy button next to each field to copy the result.
Worked examples
The largest 32-bit signed integer
- Input
0x7FFFFFFFin the hex field- Result
- Decimal 2147483647, binary in groups of 4 0111 1111 1111 1111 1111 1111 1111 1111, 31 bits, 4 bytes
The 0x prefix is accepted and ignored. This is the value at which a signed 32-bit counter overflows; adding 1 in a program would wrap around to −2,147,483,648.
Reading chmod 644
- Input
644in the octal field- Result
- Decimal 420, binary 110100100, hex 1A4
Each octal digit is three bits: 6 = 110 (rw-), 4 = 100 (r--), 4 = 100 (r--). So the owner can read and write, and everyone else can only read.
Short IDs in base 36
- Input
1000000in the decimal field, base 36 selected under Any base- Result
- Base 36 LFLS, hex F4240
Base 36 uses 0–9 and A–Z, so one million fits in four characters. That is why some URL shorteners and order numbers use it.
How base conversion works
Decimal → base N: divide by N repeatedly and read the remainders from bottom to top. Example: 13 → 13÷2 = 6 r 1, 6÷2 = 3 r 0, 3÷2 = 1 r 1, 1÷2 = 0 r 1 → 1101₂
Base N → decimal: multiply each digit by the matching power of N and add them up. Example: 1A₁₆ = 1×16 + 10×1 = 26
Binary ↔ hex: group binary digits in fours from the right; each group is one hex digit (groups of three for octal). 1101 0111₂ = D7₁₆
Common values
| Decimal | Binary | Octal | Hex |
|---|---|---|---|
| 8 | 1000 | 10 | 8 |
| 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 |
Negative numbers and two’s complement
The converter writes negative numbers with a minus sign, as in math: −1010₂. Computers usually store negatives in two’s complement, where −x in n bits is 2ⁿ − x. Example: −10 in 8 bits = 256 − 10 = 246 = 1111 0110₂ (0xF6). The info box shows the two’s complement in the smallest width that fits (8, 16, 32, 64 or 128 bits).
FAQ
Can it convert very large numbers?
Yes. It uses integers without a digit limit, so numbers with dozens of digits convert exactly. Numbers with a fractional part are not supported.
Can I type lowercase hex?
Yes. Input is case-insensitive; results are shown in uppercase (A–F).
Why does it stop at base 36?
The ten digits 0–9 plus the 26 letters A–Z give 36 symbols. Base 36 is sometimes used for short IDs and URL shorteners.
Is 0xFF the same as FF?
Yes. 0x only marks a number as hexadecimal, so you can type it with or without the prefix in the hex field; the same goes for 0b in the binary field and 0o in the octal field. In the decimal field, 0x is reported as an invalid digit.
What do the bits and bytes figures mean?
Bits is the minimum number of binary digits needed for the value (without the sign), and bytes rounds that up to whole 8-bit bytes. For example, 420 needs 9 bits, so it doesn't fit in one byte (maximum 255) and needs 2. For color values such as #FF8800, the color converter also shows RGB and HSL.