↑ ↓ to move · Enter to open · Esc to close

🔢 Number Base Converter

Convert any whole number between binary, octal, decimal, hexadecimal and custom bases up to 36 – even very large numbers.

Quick answer: Each digit is multiplied by the base raised to its position and the results are added. For example, decimal 255 is 11111111 in binary, 377 in octal and FF in hexadecimal.

Updated · Free · No sign-up · Works on any device

Number Base Converter inputs

Used for custom input and shown as an extra result.

Result

Hexadecimal

FF

Binary (base 2)1111 1111
Octal (base 8)377
Decimal (base 10)255
Hexadecimal (base 16)FF
Base 36 (base 36)73

8 significant bits

How positional number systems work

In any base b, each digit is worth its face value multiplied by b raised to the power of its position, counting from zero on the right. Decimal uses ten digits, binary two, octal eight and hexadecimal sixteen (0–9 then A–F).

Value = dₙ × bⁿ + … + d₁ × b¹ + d₀ × b⁰

Worked example

Hexadecimal FF = 15 × 16¹ + 15 × 16⁰ = 240 + 15 = 255. In binary the same number is 11111111 – eight ones, because 2⁸ − 1 = 255 – and in octal it is 377 (3 × 64 + 7 × 8 + 7).

Converting from decimal to another base

  1. Divide the number by the target base.
  2. Write down the remainder – it is the next digit, starting from the right.
  3. Repeat with the quotient until it reaches zero.

Quick reference

DecimalBinaryOctalHex
81000108
10101012A
16100002010
100110010014464
25511111111377FF
1024100000000002000400

Tips

  • Each hex digit maps to exactly four binary digits, and each octal digit to three – handy for converting by hand.
  • Programmers write hex with a 0x prefix and binary with 0b; the converter accepts both.
  • Numbers of any length are supported because the maths uses arbitrary-precision integers, so 64-bit and larger values convert exactly.

Where you will meet other bases

Binary underpins every computer, octal still appears in Unix file permissions such as chmod 755, and hexadecimal is used for colour codes like #FF8800, memory addresses and MAC addresses. Base 36 is popular for short IDs because it packs many values into few characters.

Frequently asked questions

How do I convert binary to decimal?

Write the powers of two under each bit from the right (1, 2, 4, 8 …) and add the ones under a 1. For 1011 that is 8 + 0 + 2 + 1 = 11.

How do I convert decimal to hexadecimal?

Divide by 16 repeatedly and write down the remainders, using A–F for 10–15, then read them from bottom to top. 255 ÷ 16 = 15 remainder 15, so 255 is FF.

Can I enter a 0x or 0b prefix?

Yes. A 0x prefix is ignored for hexadecimal input, 0b for binary and 0o for octal. Spaces and underscores used as digit separators are also ignored.

Why is there a limit of base 36?

Base 36 uses all ten digits plus the 26 letters of the alphabet. Higher bases would need extra symbols that have no standard convention.