Number Base Converter

Binary (2)
—
Octal (8)
—
Decimal (10)
—
Hexadecimal (16)
—

Common conversions

DecimalBinaryOctalHex
0000
1111
21022
81000108
10101012A
16100002010
25511111111377FF
What are binary numbers?

Binary numbers use only digits 0 and 1 (base 2). Computers use binary internally. Example: 1010 (binary) = 10 (decimal).

What are hexadecimal numbers?

Hexadecimal uses base 16 with digits 0–9 and letters A–F. Commonly used in programming for colors and memory addresses. Example: FF (hex) = 255 (decimal).

How do you convert between number systems?

Multiply each digit by the base raised to its position and sum. Example: 1010₂ = 1×2³ + 0×2² + 1×2¹ + 0×2⁰ = 8 + 0 + 2 + 0 = 10.

What is a number base?

A number base is the number of different digits a system uses. Everyday numbers are in base 10 (digits 0–9). Computers work in base 2, or binary, with just 0 and 1, and programmers also use octal (base 8, digits 0–7) and hexadecimal (base 16, digits 0–9 plus A–F).

The base only changes how a quantity is written, not the quantity itself. The value eleven is 11 in decimal, 1011 in binary, 13 in octal and B in hexadecimal — four labels for the same amount.

How to use this base converter

  1. Choose the system of your input in the From base dropdown: Decimal (10), Binary (2), Octal (8) or Hexadecimal (16).
  2. Type the value in the input box, for example 255 or 1011.
  3. Press Convert.
  4. Read all four results at once: the same value shown in Binary (2), Octal (8), Decimal (10) and Hexadecimal (16).

How the conversion works

Every system is positional: each digit is worth its face value times the base raised to its position, counting from 0 on the right. That single rule converts any base to decimal.

d₂ d₁ d₀ (base b) = d₂×b² + d₁×b¹ + d₀×b⁰

Example 1: binary 1011 to decimal

Apply the rule with b = 2: 1×2³ + 0×2² + 1×2¹ + 1×2⁰ = 8 + 0 + 2 + 1 = 11. So the binary number 1011 and the decimal number 11 are the same quantity.

1011₂ = 11₁₀

Example 2: decimal 45 to binary, hex and octal

Build 45 from powers of 2: 32 + 8 + 4 + 1 = 45. Placing 1s in those positions gives 101101₂. In hexadecimal, 45 = 2×16 + 13, and 13 is the letter D, so it is 2D₁₆. In octal, 45 = 5×8 + 5, so it is 55₈.

45 = 101101₂ = 55₈ = 2D₁₆

Example 3: hex FF to decimal

F is worth 15, so FF = 15×16 + 15 = 240 + 15 = 255. This is why FF shows up everywhere as the maximum of one byte, for example pure white in RGB color codes.

FF₁₆ = 255₁₀

Tips and common mistakes

Check your digits against the base: an 8 or 9 can never appear in octal, and binary only allows 0 and 1. A digit equal to or larger than the base is the sign of a wrong conversion.

A handy shortcut for binary-hex: each hex digit is exactly four binary digits, since 2⁴ = 16. F = 1111, 2 = 0010, so hex 2F is 101111 in binary — group the bits in fours to see it.

Frequently asked questions

Why do computers use binary?

Because electronic circuits are reliable at telling two states apart, such as high and low voltage. Each wire carries one bit, 0 or 1, and billions of them together represent numbers, text and images.

What is octal still used for?

Mainly in Unix and Linux file permissions. The code 755 means 7 (read, write, execute) for the owner and 5 (read, execute) for group and others — three digits, one octal number each.

How do I convert decimal to binary step by step?

Divide by 2 repeatedly and keep the remainders. For 45: 45÷2 = 22 remainder 1, 22÷2 = 11 r0, 11÷2 = 5 r1, 5÷2 = 2 r1, 2÷2 = 1 r0, 1÷2 = 0 r1. Reading the remainders bottom-up gives 101101.

What does the 0x prefix mean in programming?

It marks a number as hexadecimal in most programming languages. The code 0xFF is simply the hex value FF, which equals 255 in decimal.