Number Base Calculator

Enter a non-negative whole number in the base you know: binary, octal, decimal or hexadecimal. You will see its value in all four bases at once. The arithmetic panel adds or subtracts two binary numbers.

Input base
Binary1010
Octal12
Decimal10
HexadecimalA
Binary arithmetic
Result: 10000 (decimal 16)

The four number bases

Binary (base 2) uses the digits 0 and 1 and is how computers store data. Octal (base 8) uses 0–7 and still appears in Unix file permissions such as 755. Decimal (base 10) is everyday counting. Hexadecimal (base 16) uses 0–9 and A–F, where A = 10 and F = 15; it is used for colors (#FF8800), memory addresses and byte values.

Decimal to binary, octal or hex

Divide the number repeatedly by the target base and write the remainders from last to first. Example: 2026 ÷ 16 = 126 remainder 10 (A); 126 ÷ 16 = 7 remainder 14 (E); 7 ÷ 16 = 0 remainder 7, so 2026 = 7EA in hex. The same method gives 11111101010 in binary and 3752 in octal.

Binary, octal or hex to decimal

Multiply each digit by the base raised to its position, counting from 0 at the right, and add the results. Hex 7EA = 7 × 16² + 14 × 16 + 10 = 1,792 + 224 + 10 = 2,026. Binary 1011 = 8 + 0 + 2 + 1 = 11.

Shortcut between binary and hex or octal

Each hex digit is exactly four binary digits and each octal digit is three. Split binary into groups from the right: 1111 1110 1010 is F E A, but with the leading group 111 1110 1010 it reads 7EA. For octal, 11 111 101 010 gives 3 7 5 2.

Quick reference

Decimal 10 = binary 1010 = octal 12 = hex A. Decimal 15 = 1111 = 17 = F. Decimal 16 = 10000 = 20 = 10. Decimal 100 = 1100100 = 144 = 64. Decimal 255 = 11111111 = 377 = FF (the largest value of one byte). Decimal 1024 = 10000000000 = 2000 = 400.

Frequently asked questions

How do I convert decimal to binary?

Divide by 2 repeatedly and read the remainders from bottom to top. 13 ÷ 2 = 6 r1, 6 ÷ 2 = 3 r0, 3 ÷ 2 = 1 r1, 1 ÷ 2 = 0 r1, so 13 = 1101.

What is FF in decimal?

255. F is 15, so FF = 15 × 16 + 15 = 255, the largest number that fits in one byte.

How do I convert hex to binary?

Replace each hex digit with its 4-bit binary value: A = 1010, 3 = 0011, so A3 = 10100011.

Why do programmers use hexadecimal?

One hex digit represents exactly four bits, so a byte is always two hex digits. That makes long binary values much shorter and easier to read.

Does the converter handle negative numbers or fractions?

No. It converts non-negative whole numbers. Signed values (two's complement) and fractional parts are not supported.