Binary to decimal converter

To convert binary to decimal, add the place values of the 1 bits, which double from the right: 1, 2, 4, 8, 16 and so on. So 1011 is 8 + 2 + 1 = 11. Paste a binary number below for its exact decimal value at any length. The conversion runs in your browser.

Input number

Enter a whole number and choose the bases.

Enter a whole number, choose the bases, then convert.

Allowed digits depend on your input base.

Swap uses the result as your next input when one is available.

Whole numbers only. Enter digits without prefixes or separators: FF, not 0xFF. Surrounding whitespace is ignored.

Converted number

The same integer in your chosen base.

Exact whole-number conversion

Binary to decimal conversion table

The decimal column is the converter's output for each binary number, computed when the page was built. No value was typed by hand.
BinaryDecimal
11
102
113
1004
1015
1117
10008
101010
111115
1000016
1010121
1111131
10000032
1100100100
11111111255
100000000256

A 1 followed by zeros is always a power of 2. 10 is 2, 100 is 4, 1000 is 8, and 100000000 is 256. A run of 1s is one less than the next power, so 1111 is 15 and 11111111 is 255.

Odd numbers always end in 1 and even numbers in 0, because every place value except the rightmost 1 is even. That makes the last bit a quick check on any result: 10101 ends in 1 and gives the odd number 21.

How to convert binary to decimal

Binary is base 2, with only the digits 0 and 1. Each place is worth twice the place to its right. From the right, the place values are 1, 2, 4, 8, 16, 32, 64 and 128 for the first eight bits.

Write those values over the bits, keep the ones above a 1 and add them. For 1100100 the 1 bits sit on 64, 32 and 4, and 64 + 32 + 4 = 100. For 10101 they sit on 16, 4 and 1, which gives 21.

The doubling method works from the left. Start at 0, and for each bit double the total and add the bit. For 1011 that runs 1, 2, 5, 11. The converter reads the digits this way with exact integers, so a string of hundreds of bits gives every decimal digit.

Converting a byte to decimal

A byte is 8 bits, so its value runs from 00000000, which is 0, to 11111111, which is 255. The leading zeros of a byte are allowed in the Number field: 00000001 gives 1, 01000001 gives 65 and 10000000 gives 128. Each byte therefore has 256 possible values.

The 65 of 01000001 is also the ASCII code of the capital letter A. This page returns the number only. It does not turn bytes into letters or read binary text.

Convert one byte at a time. A space between bytes is rejected, so 01000001 01000010 gives an error. If you join the two bytes into one 16-bit string, the converter reads them as a single number, and 0100000101000010 gives 16706. The largest 16-bit string, sixteen 1s, gives 65535, which is 2 to the power 16 minus 1.

Using the binary to decimal converter

The page opens with Binary (2) in From base and Decimal (10) in To base. Type or paste the bits in the Number field and select Convert number. The Converted number panel shows the decimal value, with Copy result and Download TXT beside it.

Only 0 and 1 are valid digits here. A 2 in 1102 is rejected as a digit that is not valid in the input base, and so is the b of a 0b1010 prefix. A binary point, as in 1010.1, is rejected because the converter takes whole numbers only.

The converter reads the bits as an unsigned number with an optional sign. It does not apply two's complement, so 11111011 gives 251, not −5. Swap bases turns the form into decimal to binary and moves the result into the Number field. Reset returns to binary to decimal.

Questions

How do I convert 10101 to decimal?

Write the place values 16, 8, 4, 2 and 1 over the five bits. The 1 bits sit on 16, 4 and 1, and 16 + 4 + 1 = 21. So 10101 in binary is 21 in decimal. Type 10101 on this page and select Convert number to check it.

How much is 11111111 in binary?

11111111 in binary is 255 in decimal. Its eight 1 bits add up to 128 + 64 + 32 + 16 + 8 + 4 + 2 + 1, which is 255. It is the largest value that one byte can hold, and 2 to the power 8 minus 1.

What is 0010 in binary?

0010 is the binary number 10 with two leading zeros, and its value is 2 in decimal. Leading zeros never change the value, so 10, 0010 and 00000010 all convert to 2 here. Fixed-width fields, such as 4-bit groups or bytes, often keep the zeros.

Can I convert several bytes at once?

Not as separate values. The converter reads one whole number, so a space between bytes gives an error. Joined together, 0100000101000010 is read as the single 16-bit number 16706. To get each byte's value, convert them one at a time: 01000001 is 65 and 01000010 is 66.