easyonlinecalculator

Binary Converter

Type a whole number, pick the base it is written in, and see it in binary, octal, decimal and hexadecimal at once, with the bit count and the binary in groups of four. Any base from 2 to 36 works, and the steps are shown.

Last updated November 3, 2026

Whole numbers only. A minus sign, a matching 0b, 0o or 0x prefix, spaces and underscores are fine.

Result

1010 in base 2 = 10 in decimal

The number in binary, octal, decimal and hexadecimal
Binary (base 2)1010
Octal (base 8)12
Decimal (base 10)10
Hexadecimal (base 16)A
Bit count4
Binary in groups of 41010
Show the work

Formula: value = sum of (digit × base^position); to write it in another base, divide repeatedly and read the remainders

  1. Read 1010 as a base 2 number.
  2. Multiply each digit by its place value (2 to the power of its position), left to right: 1 × 8 = 8; 0 × 4 = 0; 1 × 2 = 2; 0 × 1 = 0.
  3. Add the products: 10 in decimal.
  4. Divide 10 by 2 until the quotient is 0: 10 ÷ 2 = 5 remainder 0; 5 ÷ 2 = 2 remainder 1; 2 ÷ 2 = 1 remainder 0; 1 ÷ 2 = 0 remainder 1.
  5. Read the remainders from the last division up to the first: 1010 in binary (4 bits).
  6. Group the bits in fours, 1010, and write each group as one hexadecimal digit, A: A. Octal groups the bits in threes: 12.

Result: 1010 (base 2) = 1010 binary = 12 octal = 10 decimal = A hexadecimal

How a number changes base

Formula

value = sum of (digit × base^position), counting positions from 0 on the right

to write a value in a new base, divide by the base again and again and read the remainders upward

Each place in a number is worth the base raised to its position. In decimal the places are 1, 10, 100 and so on. In binary they are 1, 2, 4, 8, 16, and each digit is only 0 or 1.

To read a number, multiply each digit by its place value and add the results. To write a value in another base, divide by that base, note the remainder, and repeat with the quotient until it reaches 0. The remainders, read from last to first, are the new digits.

Letters stand for digits above 9: A is 10, B is 11, up to Z, which is 35. That is why the highest base here is 36.

See how we calculate for the formulas, sources and review schedule behind every calculator.

Also useful alongside this calculator: Basic Calculator, Square Root Calculator and Factor Calculator.

Converting binary to decimal

Write the place values under the bits from the right: 1, 2, 4, 8. Add those that sit under a 1. For 1010 the places are 8, 4, 2 and 1, the ones are under 8 and 2, and 8 + 2 = 10.

The all-ones pattern is the largest value for its length: eight ones, 11111111, equal 255.

Converting decimal to binary

Divide the number by 2 and write the remainder, which is always 0 or 1. Repeat with the quotient until it is 0, then read the remainders from the bottom up.

For 100, the remainders are 0, 0, 1, 0, 0, 1, 1 from first to last. Read upward, that is 1100100, which has 7 bits. Show the work lists these divisions, and for very long numbers it shows only the first and last few.

Hexadecimal and octal shortcuts

Since 16 is 2 to the power of 4, one hexadecimal digit stands for exactly four bits. Split the binary into groups of four from the right and replace each group with one digit. The groups 0110 and 1011 become 6 and B, so 01101011 is 6B, which is 107 in decimal.

Octal works the same way with three bits per digit, because 8 is 2 cubed. The binary 1111101 splits into 1, 111 and 101, which gives octal 175 or 125 in decimal.

Negative numbers, prefixes and limits

A leading minus sign is kept as a sign in front of the digits, so -1010 in binary is -10 in decimal and -A in hexadecimal. This is signed magnitude. It is not two's complement, the scheme many computers use for negative integers in a fixed number of bits.

A 0b, 0o or 0x prefix is accepted when it matches the chosen base, and spaces or underscores are ignored. A decimal point is rejected, and a wrong digit, such as a 2 in a binary number, is named in the error.

Values can run to 256 characters and results are exact: 2 to the power of 64 is 18446744073709551616, or 10000000000000000 in hexadecimal, and needs 65 bits.

How to use the Binary Converter

  1. Type the whole number in the Value box. A minus sign, spaces, underscores and a matching 0b, 0o or 0x prefix are allowed.
  2. Choose the base it is written in under From base, or pick Custom and enter a base from 2 to 36.
  3. Read the binary, octal, decimal and hexadecimal results, the bit count and the binary in groups of four.
  4. Open Show the work to see the place values and divisions for your number.
  5. Use Copy, Print or Share to keep the result.

Worked example

Worked example

Take decimal 255. Dividing by 2 repeatedly gives eight remainders of 1, so the binary is 11111111, with 8 bits. In fours that is 1111 1111, which is FF. In threes it is 11, 111, 111, which is octal 377. Check: 15 × 16 + 15 = 255.

Whole numbers in four bases
DecimalBinaryOctalHexadecimal
10101012A
100110010014464
25511111111377FF
256100000000400100
40951111111111117777FFF

Frequently asked questions

How do I convert binary to decimal?

Multiply each bit by its place value, which doubles from the right (1, 2, 4, 8 and so on), and add the results. For 1010 that is 8 + 2 = 10.

What is FF in binary and decimal?

FF is 11111111 in binary and 255 in decimal. Each F is 1111, and 15 × 16 + 15 = 255.

Does this binary converter handle fractions or negative numbers?

It handles whole numbers only, so a decimal point is rejected. Negative numbers are shown with a minus sign, not as two's complement.

What does base 36 mean?

Base 36 uses the digits 0 to 9 and the letters A to Z. For example, ZZ is 35 × 36 + 35 = 1295 in decimal.

How many bits does a number need?

It needs as many bits as its binary form has digits. For example, 255 needs 8 bits, 256 needs 9 and 2 to the power of 64 needs 65.