Skip to content

Binary to Decimal Converter

Type a binary number to get its decimal value, with each bit’s place value (1, 2, 4, 8 …) shown and added up.

Binary uses only 0 and 1

In decimal (base 10)

45

Binary 10 1101 is 45 in decimal (base 10).

27128
2664
2532
2416
238
224
212
201

32 + 8 + 4 + 1 = 45

Tap a bit to flip it. Each tile is worth its digit × 2n.

How to convert binary to decimal

Binary is base 2: each position 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 for a byte, and the pattern keeps doubling for longer numbers.

To convert, write the place value under every bit, keep the places that hold a 1, and add them. A 0 contributes nothing, so you only ever add powers of two. For 11010110 that is 128 + 64 + 16 + 4 + 2 = 214.

A quick check: an n-bit number is always below 2ⁿ, so an 8-bit answer can never pass 255. If the last bit is 1 the decimal number is odd.

value = bₙ₋₁×2ⁿ⁻¹ + … + b₂×4 + b₁×2 + b₀×1

  • JavaScript stores numbers as 64-bit floats, so integers are exact only up to 2⁵³ − 1 = 9,007,199,254,740,991; this converter uses BigInt and stays exact beyond that. Source: ECMAScript, Number.MAX_SAFE_INTEGER.

Common binary numbers in decimal

Counting from 0 to 16, then the powers of two and all-ones values programmers meet most.

Counting from 0 to 16, then the powers of two and all-ones values programmers meet most.
BinaryDecimalWhy it matters
00nothing set
112^0
1022^1
113
10042^2
1015
1106
1117
100082^3
10019
Show all 26 rows
101010ten: 1010, not 10
101111
110012
110113
111014
111115
10000162^4
100000322^5
1000000642^6
1111111127largest 7-bit value (ASCII)
10000000128top bit of a byte
11111111255largest byte
100000000256values in one byte
11111111111,023ten bits all on
100000000001,0242^10, one kibi
1111 1111 1111 111165,535largest 16-bit value

Frequently Asked Questions

What is 1111 in binary as a decimal?

1111 in binary is 15: 8 + 4 + 2 + 1. Four bits all set is always 2⁴ − 1 = 15, which is why one hex digit (0 to F) covers exactly four bits.

Why does binary 10 equal 2?

In base 2 the second place from the right is worth 2 instead of 10. So 10 in binary means one 2 and no 1s, which is 2. Writing 0b10 makes the base clear in code.

How do I convert a binary fraction such as 101.11?

Places right of the point are worth ½, ¼, ⅛ and so on, so 101.11 is 4 + 1 + 0.5 + 0.25 = 5.75. This tool converts whole numbers; for how computers store fractions see the IEEE 754 converter.

How long can the binary number be?

There is no practical limit: the converter works with exact big integers, so a 64-bit or 128-bit value converts without rounding. The step-by-step working is shown up to 32 bits.