Math & Utilities

Number Base

Binary, octal, decimal, hex

Instant results100% private, runs in browser

Number Base

Free · No login required · Instant results

Binary11111111
Octal377
Decimal255
HexFF

Quick Answer

Number base conversion works by parsing the input in its original base, converting to decimal (base-10), then re-expressing that decimal in the target base. For example: binary 11111111 = decimal 255 = hex FF = octal 377.

What Is Number Base?

A number base (or radix) system defines how many digits are used before the count rolls over to the next place value. Decimal uses base 10 (digits 0–9). Binary (base 2) uses only 0 and 1. Octal (base 8) uses digits 0–7. Hexadecimal (base 16) uses digits 0–9 plus letters A–F for values 10–15.

Different bases have real-world uses: Binary is fundamental to how all digital electronics work, every file and value in a computer is stored and processed as binary. Hexadecimal is used in programming because each hex digit represents exactly 4 binary digits, making binary values much shorter to write. Octal appears in Unix/Linux file permission systems.

This converter takes any number in binary, octal, decimal, or hexadecimal and shows all four representations simultaneously, useful for programmers, students, and anyone working with digital systems.

How to Use

  1. 1Type your number in the input field.
  2. 2Select the base you're converting FROM: Binary (base 2), Octal (base 8), Decimal (base 10), or Hexadecimal (base 16).
  3. 3All four base representations update instantly.

Formula

Core method
Parse input in original base → decimal integer → re-express in each target base
Binary place values
11111111₂ = 1×128 + 1×64 + 1×32 + 1×16 + 1×8 + 1×4 + 1×2 + 1×1 = 255₁₀
Hex digits
A=10 B=11 C=12 D=13 E=14 F=15

Example: Convert decimal 255 to all bases

  • Binary: 11111111
  • Octal: 377
  • Hex: FF
255 (decimal) = 11111111 (binary) = 377 (octal) = FF (hex)

Tips & Things to Know

  • Hex is used in web colors: #FFFFFF = white, #000000 = black, #FF0000 = red.
  • One byte = 8 binary bits = 2 hex digits. Max value of one byte: 11111111₂ = FF₁₆ = 255₁₀.
  • Hex in code: 0xFF (C/Python), #FF (CSS), $FF (Assembly).
  • In Unix/Linux file permissions, chmod 755 uses octal: 7 = rwx (read+write+execute), 5 = r-x (read+execute). Octal is compact for encoding three-bit groups.
  • Hex color codes in CSS are two-digit hex pairs for Red, Green, Blue, #FF5733 means R=255, G=87, B=51. This converter helps decode or verify color values.
  • Binary numbers get long quickly: decimal 1000 = 1111101000 in binary (10 digits). Hexadecimal is preferred in programming because each hex digit represents exactly 4 binary digits.

Frequently Asked Questions

What is binary and why do computers use it?

Binary (base 2) uses only 0 and 1. Computers use it because digital circuits have two states, off (0) and on (1), which map naturally to binary digits.

What is hexadecimal used for?

Hexadecimal (base 16) is used in programming, web colors, and memory addresses because each hex digit exactly represents 4 binary bits, making binary much shorter to write.

How do you convert binary to decimal?

Multiply each binary digit by its positional power of 2 (rightmost = 2⁰ = 1) and add them all. For 1010: (1×8) + (0×4) + (1×2) + (0×1) = 10.

What does FF hex equal in decimal?

FF hex = (15×16) + 15 = 240 + 15 = 255. In binary that's 11111111, all 8 bits of a byte set to 1.

What are Unix file permissions in octal?

Unix permissions like '755' are octal: 7 = 111 binary (read, write, execute), 5 = 101 (read, no write, execute), 0 = 000 (no permissions).

Related Calculators