Skip to content

Binary to Decimal Converter | Free Online Tool

Convert binary to decimal or decimal to binary instantly online. See the exact formula, worked examples, and a step-by-step breakdown for each conversion.

Binary-Decimal Converter

Convert between binary and decimal number systems instantly.

Binary numbers use only 0s and 1s

Decimal numbers use digits 0-9

Enter a value in either field to see the conversion in the other field.

Loading calculator...
📚

Documentation

Binary to Decimal Converter

A binary to decimal converter changes a number between base-2 (binary) and base-10 (decimal). Binary is the number system computers use internally, written with only 0s and 1s. Decimal is the number system people use every day, written with the digits 0 through 9. This tool converts a value typed into either field into the other system right away, and shows the arithmetic behind the result.

How the decimal system works

Decimal numbers use ten digits, 0 through 9. Each position in a decimal number stands for a power of 10. Reading from right to left, the positions are worth 1, 10, 100, 1,000, and so on.

Take the number 427:

  • 4 × 100 = 400
  • 2 × 10 = 20
  • 7 × 1 = 7

Adding these gives 400 + 20 + 7 = 427.

How the binary system works

Binary numbers use only two digits, 0 and 1. Each position stands for a power of 2 instead of a power of 10. Reading from right to left, the positions are worth 1, 2, 4, 8, 16, and so on, doubling each time.

Take the binary number 1010:

  • 1 × 8 = 8
  • 0 × 4 = 0
  • 1 × 2 = 2
  • 0 × 1 = 0

Adding these gives 8 + 0 + 2 + 0 = 10.

Binary to decimal formula

To convert a binary number to decimal, multiply each digit by the power of 2 for its position, then add the results:

Decimal = the sum of bᵢ × 2ⁱ for every digit, where bᵢ is the digit (0 or 1) at position i, counted from 0 on the right.

Example: converting 1101 to decimal

  1. 1 × 2³ = 8
  2. 1 × 2² = 4
  3. 0 × 2¹ = 0
  4. 1 × 2⁰ = 1
  5. Sum: 8 + 4 + 0 + 1 = 13

Binary 1101 equals decimal 13. Only the positions holding a 1 add anything to the total, so it helps to skip the 0s when adding by hand.

Decimal to binary formula (the division method)

To convert a decimal number to binary, divide it by 2 repeatedly and record each remainder.

  1. Divide the number by 2.
  2. Write down the remainder, which is always 0 or 1.
  3. Divide the quotient by 2 again.
  4. Repeat until the quotient reaches 0.
  5. Read the remainders from bottom to top.

Example: converting 25 to binary

  1. 25 ÷ 2 = 12, remainder 1
  2. 12 ÷ 2 = 6, remainder 0
  3. 6 ÷ 2 = 3, remainder 0
  4. 3 ÷ 2 = 1, remainder 1
  5. 1 ÷ 2 = 0, remainder 1

Reading the remainders from the last line back to the first gives 11001. Decimal 25 equals binary 11001.

How to use this converter

Type a number into either the Binary field or the Decimal field. The other field updates immediately. An invalid entry, such as a 2 in the binary field or a letter in the decimal field, shows an error message instead of a result.

The panel below the two fields shows the arithmetic behind the current conversion: the power-of-2 breakdown for binary-to-decimal, and the divide-by-2 steps for decimal-to-binary.

The converter accepts binary and decimal numbers of any size. It calculates with exact, arbitrary-precision arithmetic rather than standard floating-point math, so long values are not rounded off. It does not accept negative numbers or fractions.

Where binary to decimal conversion is used

  • IP addresses. An IPv4 address such as 192.168.1.1 is four binary bytes written as decimals. 192 is 11000000, 168 is 10101000, and 1 is 00000001.
  • File permissions. A Unix permission code like 755 is shorthand for the binary pattern 111 101 101: full access for the owner, read and execute for everyone else.
  • Bit flags. Setting a byte to 255 turns on all 8 bits, 11111111. Software often uses one number this way to mark several settings as on at once.
  • Digital hardware. Circuit registers store settings as bits, so configuring a device can mean converting a decimal value into the exact bit pattern it needs.

Related number systems

Hexadecimal (base 16) and octal (base 8) are shorthand ways of writing binary. Each hexadecimal digit stands for exactly 4 binary bits, and each octal digit stands for exactly 3 binary bits.

  • Binary 10101101 is hexadecimal AD, equal to decimal 173.
  • Binary 101011 is octal 53.

Frequently asked questions

What is a binary number?

A binary number is written using only two digits, 0 and 1. Each digit is called a bit. Any whole number can be written in binary by combining enough bits, the same way any word can be written using a limited alphabet of letters.

Why do computers use binary instead of decimal?

Electronic circuits can store and switch two clear states, such as high and low voltage, more cheaply and reliably than ten distinct voltage levels. Two-state logic also matches Boolean algebra, the branch of mathematics that digital circuits use to perform calculations.

How do I convert binary to decimal by hand?

Multiply each binary digit by the power of 2 that matches its position, counted from 0 on the right, then add the results. For binary 1101: 1×8 + 1×4 + 0×2 + 1×1 = 13.

How do I convert decimal to binary by hand?

Divide the decimal number by 2 repeatedly, writing down each remainder, until the quotient reaches 0. Then read the remainders from the last one back to the first. Decimal 13 becomes binary 1101 this way.

Does this converter support negative numbers or fractions?

No. It accepts non-negative whole numbers only. Negative binary numbers use a separate scheme called two's complement, and binary fractions are a different topic from whole-number conversion.

What is the largest number this converter can handle?

There is no fixed size limit. The converter uses arbitrary-precision arithmetic, so it converts very long binary or decimal numbers exactly, including values far beyond what ordinary floating-point math can represent without rounding errors.

What is the difference between binary, octal, and hexadecimal?

All three are positional number systems, like decimal, but with different bases: binary uses base 2, octal uses base 8, and hexadecimal uses base 16. One hexadecimal digit always equals exactly 4 binary bits, and one octal digit always equals exactly 3 binary bits, which is why they are used as compact shorthand for long binary numbers.