Skip to content
RightYantra
Text & developer

Binary to Decimal Converter

Paste a binary number and get its decimal value, with every bit's place value laid out so you can follow — or check — the arithmetic. Long binary strings, fractional parts like 101.11 and signed readings are all handled.

How to use it· 4 steps
  1. Type or paste the binary number. Spaces between groups of bits are fine, and so is a 0b prefix.
  2. The decimal value appears at once, along with octal, hex and base 36.
  3. The working below lists each bit, its power of two and what it adds, then the sum.
  4. If the bits come from a signed integer, open the two's complement panel to see what they mean as a signed value.
Binary to Decimal ConverterRuns on your device

Step by step

How to use the binary to decimal converter

  1. 1Type or paste the binary number. Spaces between groups of bits are fine, and so is a 0b prefix.
  2. 2The decimal value appears at once, along with octal, hex and base 36.
  3. 3The working below lists each bit, its power of two and what it adds, then the sum.
  4. 4If the bits come from a signed integer, open the two's complement panel to see what they mean as a signed value.

The method: add up the powers of two

Every position in a binary number is worth twice the one to its right. Reading from the right, the places are worth 1, 2, 4, 8, 16, 32, 64 and 128 — the first eight powers of two, 2^0 to 2^7. A 1 in a position means that value is included; a 0 means it is not. The decimal value is the sum of the included places.

Take 101101. Number the positions from the right, starting at 0: the 1s sit at positions 5, 3, 2 and 0. Those are worth 32, 8, 4 and 1, and 32 + 8 + 4 + 1 = 45. That is the whole method, and the working panel lays it out as a table for whatever you type — the digit, its power of two, and its contribution to the total.

Leading zeros change nothing. 00101101 is still 45; the zeros only pad the number to a full byte, which is how binary is usually written when it represents stored data.

A faster way in your head: double and add

Writing out powers of two gets slow for long numbers. The doubling method avoids them: start with 0, then for each bit from the left, double what you have and add the bit. For 101101 that goes 1, then 2 + 0 = 2, then 4 + 1 = 5, then 10 + 1 = 11, then 22 + 0 = 22, then 44 + 1 = 45.

It gives the same answer because it is the same sum, regrouped — each doubling shifts every bit seen so far one place to the left. It is also how a program converts a string of bits to a number, one character at a time, and it is the easiest method to do accurately without paper.

Binary fractions

Positions to the right of the binary point carry on the pattern downwards: one half, one quarter, one eighth, one sixteenth. So 0.1 in binary is 0.5, 0.01 is 0.25, and 101.11 is 4 + 1 + 0.5 + 0.25 = 5.75.

Going this direction is the easy one. Every binary fraction has an exact decimal value, because a power of two always divides a power of ten. The result will sometimes be long — 0.0001 in binary is 0.0625, and each extra place adds a digit — but it always ends, and the converter shows it in full.

Signed binary: when 11111111 means −1

The same bits can stand for different numbers depending on how a program reads them. As an unsigned byte, 11111111 is 255. As a signed byte in two's complement — the format almost every processor uses for signed integers — it is −1, because the leftmost bit is worth −128 instead of +128: −128 + 127 = −1.

The converter's main answer treats your input as an ordinary positive number, which is what binary to decimal means in maths and in most homework. If the bits came out of a register, a file or a network packet as a signed value, open the two's complement panel: it shows the same pattern at 8, 16, 32 and 64 bits and says when a value with its top bit set only makes sense as unsigned. To read a pattern as signed by hand, subtract 2^n when the top bit is 1 — 11111111 is 255 − 256 = −1.

Mistakes that give the wrong answer

Counting positions from the left. The rightmost bit is always position 0, worth 1, regardless of how long the number is. Starting at the left gives the right answer only by accident.

Losing your place in a long string. Thirty-two bits in a row are hard to count; split them into groups of four from the right, as the converter does, and each group is a single hex digit. Then 1111 1111 1111 1111 is easy to recognise as FFFF, or 65,535.

Reading 10 as ten. In binary, 10 is two and 100 is four. When binary and decimal appear on the same page, writing the base as a subscript — 101₂ — or with a 0b prefix avoids the ambiguity.

Where you will meet binary numbers

Networking is the most common place. An IPv4 subnet mask of 255.255.255.0 is 11111111.11111111.11111111.00000000 — 24 ones, which is what the /24 in 192.168.1.0/24 counts. Each part of an IP address is one byte, so each is a binary number from 0 to 255; 192 is 11000000 and 168 is 10101000.

Bit flags are the other: a settings value of 13 is 1101, meaning flags 8, 4 and 1 are on and flag 2 is off. Converting the number to binary is the quickest way to see which options a configuration value actually enables.

Answers

Frequently asked questions

How do you convert binary to decimal?

Write the place value under each bit — 1, 2, 4, 8, 16 and so on from the right — and add the place values wherever the bit is 1. For 101101 that is 32 + 8 + 4 + 1 = 45.

What is 11111111 in decimal?

255 as an unsigned number, the largest value one byte can hold. Read as a signed 8-bit integer in two's complement, the same bits mean −1.

How do I convert a binary fraction like 0.101?

Places after the point are worth ½, ¼, ⅛ and so on. 0.101 is 0.5 + 0.125 = 0.625. Every binary fraction has an exact decimal value, and the converter shows it in full.

Does it work for very long binary numbers?

Yes. The conversion is exact at any length — a 64-bit or 128-bit value converts digit for digit. The step-by-step table is listed for numbers up to 40 digits.

Why is my answer different from my calculator's?

Usually because one of them is treating the bits as signed. A calculator in programmer mode set to a fixed word size may show 11111111 as −1; as a plain binary number it is 255. Check the two's complement panel to compare both readings.