Binary to Decimal Conversion: Step-by-Step Guide

Try the Binary Converter
Binary to Decimal Conversion: Step-by-Step Guide

The Core Idea

Binary is base 2. Decimal is base 10. To convert a binary number to decimal, multiply each bit by its place value and add the results.

In binary, place values are powers of two:

128 64 32 16 8 4 2 1

The rightmost bit is worth 1, the next is worth 2, then 4, 8, 16, and so on.

Example: Convert 1101 to Decimal

Write the place values above the bits:

8 4 2 1
1 1 0 1

Add the place values where the bit is 1:

8 + 4 + 1 = 13

So binary 1101 equals decimal 13.

Example: Convert 101010

32 16 8 4 2 1
 1  0 1 0 1 0

Add 32 + 8 + 2 = 42. Binary 101010 equals decimal 42.

8-Bit Byte Example

A byte has eight bits, so it can represent values from 0 to 255:

128 64 32 16 8 4 2 1
  0  1  0  0 1 0 0 0

This is 64 + 8 = 72. In ASCII, decimal 72 is the letter H, so 01001000 represents H.

Decimal to Binary in Reverse

To convert decimal to binary, subtract powers of two or repeatedly divide by two. For decimal 42:

  • 32 fits, so the 32 bit is 1.
  • Remainder is 10.
  • 16 does not fit, so the 16 bit is 0.
  • 8 fits, remainder is 2.
  • 4 does not fit.
  • 2 fits, remainder is 0.
  • 1 does not fit.

The result is 101010.

Why Programmers Use Binary, Decimal, and Hex

Binary shows exact bit patterns, but long binary strings are hard to read. Decimal is convenient for humans. Hexadecimal is compact because every hex digit maps to four bits. The byte 01001000 is 48 in hex and 72 in decimal.

Common Byte Values

Binary Decimal Meaning
00000000 0 Null byte
00100000 32 Space in ASCII
01000001 65 A in ASCII
01100001 97 a in ASCII
11111111 255 Maximum unsigned byte

Avoiding Mistakes

Keep byte boundaries clear when decoding text. A binary text string like 0100100001101001 should be split into 01001000 01101001 before converting to decimal. Otherwise you may convert the whole string as one large number instead of two character bytes.

Frequently Asked Questions

What is the decimal value of 11111111?

11111111 equals 255 because all eight place values are active: 128 + 64 + 32 + 16 + 8 + 4 + 2 + 1.

Why does one byte stop at 255?

Eight bits have 256 possible combinations. If counting starts at 0, the maximum unsigned value is 255.

Is binary conversion different for text?

The math is the same, but text conversion also needs a character encoding such as ASCII or UTF-8 to map numbers to characters.

Convert Binary Instantly

Convert between binary, text, decimal, hex, and octal with our free online tool.

Open Binary Converter