How to use the Number Base Converter
- Type a number in any field
- All other bases update instantly
- Copy the value you need
Binary, decimal, octal and hex together
Type a number in any box — decimal, binary, octal or hexadecimal — and the others update instantly. A custom box converts to and from any base from 2 to 36. It handles very large and negative numbers, accepts prefixes such as 0x and 0b, and shows how many bits the number needs. Whole numbers only.
Binary to decimal by hand
Multiply each digit by its power of 2 and add them up: 1101 = 1×8 + 1×4 + 0×2 + 1×1 = 13, and 1010 = 8 + 2 = 10. Four bits cover 0000 = 0 to 1111 = 15.
Decimal to binary by hand
Divide by 2 repeatedly and read the remainders from bottom to top: 25 → 12 r1 → 6 r0 → 3 r0 → 1 r1 → 0 r1 = 11001. Likewise, 10 = 1010.
Hexadecimal
Hex digits go 0–9, then A–F for 10–15. FF = 15×16 + 15 = 255, and 255 = FF. Web colours work the same way: rgb(255, 128, 0) → FF, 80, 00 → #FF8000. For comparison, 255 is 377 in octal and 11111111 in binary.
In Excel and Python
- Excel —
=BIN2DEC("1101"),=HEX2DEC("FF"),=DEC2BIN(25)and=DEC2HEX(255). - Python —
int("1101", 2),bin(25)andint("ff", 16).