How to use Binary ↔ Decimal
- 1
Select the input format (Binary, Decimal, Octal, or Hexadecimal).
- 2
Type your number in the input field.
- 3
See all four conversions displayed instantly.
Convert numbers between Binary, Decimal, Octal, and Hexadecimal instantly. All four results shown simultaneously with copy buttons.
Select the input format (Binary, Decimal, Octal, or Hexadecimal).
Type your number in the input field.
See all four conversions displayed instantly.
JavaScript can safely handle integers up to 2^53 - 1. For most computing and programming purposes, this is more than sufficient.
Octal (base 8) is used in Unix/Linux file permissions. For example, chmod 755 uses octal notation.
Every number you write down is expressed in a base — a positional system that defines how many symbols are available and how place value works. Humans default to base 10 (decimal) because we have 10 fingers. Computers use base 2 (binary) at the hardware level because transistors have two states: on or off. Programmers frequently work in base 16 (hexadecimal) because it maps neatly to binary bytes.
This converter lets you type a number in any of the four main systems and see its equivalent in all others simultaneously — no switching tabs, no manual arithmetic.
Decimal (Base 10) — The everyday system. Digits: 0–9. Positional value: each place is 10× the one to its right. The number 255 means (2 × 100) + (5 × 10) + (5 × 1).
Binary (Base 2) — The hardware language. Digits: 0 and 1 only. Each place is 2× the previous. The number 11111111 in binary = 255 in decimal. Every file, pixel, and byte your computer processes is ultimately stored this way.
Octal (Base 8) — Digits 0–7. Primarily seen in Unix/Linux file permissions. When a developer types chmod 755, those three digits are octal — each representing three bits of the binary permission string. 7 = 111 binary = read+write+execute.
Hexadecimal (Base 16) — Digits 0–9, then A–F. A = 10, B = 11, ... F = 15. Each hex digit represents exactly 4 binary bits, making it a compact and human-readable way to express binary data. Two hex digits = one byte. Used everywhere: memory addresses, colour codes, cryptographic hashes.
Every conversion routes through decimal as an intermediate:
Any base → Decimal: Multiply each digit by its positional value and sum.
Binary 1011 = (1 × 8) + (0 × 4) + (1 × 2) + (1 × 1) = 11
Hex B = 11
Octal 13 = (1 × 8) + (3 × 1) = 11
Decimal → Any base: Repeatedly divide by the target base and collect remainders.
11 ÷ 2 = 5 R1
5 ÷ 2 = 2 R1
2 ÷ 2 = 1 R0
1 ÷ 2 = 0 R1 → Read remainders bottom-to-top: 1011
Binary: You won't often type raw binary — it's what CPUs work with internally. But you'll encounter it when reading about bit flags, network masks (a /24 subnet mask is 11111111.11111111.11111111.00000000), or working with embedded systems.
Octal: Mainly Unix file permissions. When you see drwxr-xr-x, that's 755 in octal: owner has 7 (read+write+execute), gro...
Looking for a more detailed deep-dive and advanced tips?
Read Full Article on our BlogYour data never leaves this device. All processing is handled locally by JavaScript.
Convert numbers between Binary, Decimal, Octal, and Hexadecimal instantly.
Binary (Base 2)
0b11111111
Octal (Base 8)
0o377
Hexadecimal (Base 16)
0xFF