Converters

Number base converter

Binary, octal, decimal and hexadecimal.

  • Instant
  • Free
  • Private (processed locally)
  • No sign-up
Binary base 2
Octal base 8
Decimal base 10
Hexadecimal base 16

Understanding number bases

We usually count in base 10 (decimal), with ten digits from 0 to 9. But computers think in base 2 (binary), because a circuit only knows two states: 0 and 1. Other bases help write that data more readably: octal (base 8) and especially hexadecimal (base 16).

In any base, a digit’s position indicates a power of the base. In decimal, 235 = 2×10² + 3×10¹ + 5×10⁰. In hexadecimal, EB = 14×16 + 11 = 235. It is the same number, written differently.

How to use the converter

  1. Enter a number

    Type the value to convert, for example 255.

  2. Choose its input base

    State whether your number is decimal, binary, octal or hexadecimal.

  3. Read all four results

    The conversions in the four bases appear instantly.

Base conversion table

Here are the numbers 0 to 16 written in the four most common bases:

Decimal (10)Binary (2)Octal (8)Hexadecimal (16)
0000
1111
21022
31133
410044
510155
611066
711177
81000108
91001119
10101012A
11101113B
12110014C
13110115D
14111016E
15111117F
16100002010

Notice that hexadecimal uses the letters A to F to represent 10 to 15.

Conversion methods

Decimal to binary

Repeatedly divide the number by 2, note each remainder (0 or 1), then read the remainders from last to first.

Binary to decimal

Add up the powers of 2 for the bits set to 1. Example: 1101 = 8 + 4 + 0 + 1 = 13.

What are the different bases used for?

  • Binary: native language of processors and memory.
  • Octal: Unix file permissions (chmod), sometimes in electronics.
  • Hexadecimal: web colors, memory addresses, debugging, encoding.

Frequently asked questions

What is a number base?

The base is the number of distinct digits used to write numbers. Base 10 (decimal) uses ten (0–9), base 2 (binary) two (0 and 1), base 16 (hexadecimal) sixteen (0–9 then A–F). The same number is written differently depending on the base.

How do I convert a decimal number to binary?

Repeatedly divide the number by 2, noting the remainders, then read the remainders from bottom to top. Example: 13 → 13÷2=6 r1, 6÷2=3 r0, 3÷2=1 r1, 1÷2=0 r1 → 1101.

How do I read a hexadecimal number?

Each digit represents a power of 16, and the letters A to F stand for 10 to 15. Example: 1F = 1×16 + 15 = 31 in decimal.

Why do developers use hexadecimal?

Because it is compact: one byte (8 bits) is written with exactly two hex digits. You see it in CSS colors (#FF8800), memory addresses and encoding values.

What is octal used for?

Base 8 is notably used for file permissions on Unix/Linux (e.g. chmod 755), where each digit encodes read/write/execute rights.

Is my data sent online?

No. The conversion runs locally in your browser; no number is sent to a server.