Binary to Decimal Converter

What is your binary number as a decimal value?

Paste or type any binary number and get its exact decimal equivalent — plus a position-by-position breakdown showing how each bit contributes to the total.

Updated July 2026 · How this works

Example calculation — edit any field to use your own numbers

Put this calculator on your site

Free embed code. Works anywhere. No signup.

Worth knowing
How It Works
The formula, explained simply

Imagine a row of light switches, each wired to a bulb of a different brightness. The rightmost switch controls a bulb worth 1 lumen. The next controls one worth 2, then 4, then 8 — each position doubles the previous. When you read a binary number, you are looking at a snapshot of those switches: 1 means on, 0 means off. The total light in the room is your decimal number.

This doubling pattern is what defines base 2. In the familiar decimal system, each position is worth ten times the one to its right. In binary, that multiplier is 2 instead of 10. Both systems are positional — the value of a digit is inseparable from where it sits. The digit 1 in the leftmost position of an 8-bit number is worth 128; the same digit in the rightmost position is worth exactly 1.

Converting a binary number to decimal is the act of reading those positions, multiplying each active digit by its positional weight, and adding up the contributions. No information is lost or gained in the translation — it is the same quantity expressed in a different notation. A file size of 11010110 in binary and 214 in decimal are describing the exact same count of bytes.

When To Use This
Right tool, right situation

Use this converter when you encounter a binary value in a technical context and need its decimal equivalent to reason about it — reading memory addresses, interpreting permission bits in a Unix file system, decoding colour channel values in an image file, or checking the output of a bitwise operation in code. It is also useful for verifying manual conversions done as a learning exercise.

It is the right tool when the binary string is an unsigned integer — a straightforward count or index. It is not appropriate for signed integers stored in two's complement notation, where the leftmost bit signals negativity rather than a large positive power of 2. It also does not handle binary fractions (numbers with a binary point), floating-point IEEE 754 representations, or binary-coded decimal formats used in some older systems. For those cases, a format-specific decoder is the correct choice.

Common Mistakes
Why results sometimes look wrong

Mistake 1 — Reading the positions in the wrong direction. The most common error is assigning the weight of 2 raised to the power of 0 to the leftmost digit instead of the rightmost. The rightmost bit is always the least significant bit and always carries the weight of 1. Reversing this assignment produces a completely different decimal value with no obvious error signal, making it hard to catch without a reference check.

Mistake 2 — Treating leading zeros as significant digits that change the value. A binary number like 00001010 has the same decimal value as 1010. Leading zeros are valid input and common in fixed-width formats (an 8-bit register always shows all bit positions), but they do not increase the magnitude of the number. Stripping them before converting is fine; including them is also fine — both produce the same result.

Mistake 3 — Confusing binary representation with binary arithmetic. Students new to the topic sometimes apply decimal addition rules directly to binary strings, treating a 1 next to another 1 as 11 (eleven) rather than two separate bits at different positional weights. Binary notation is not decimal shorthand — each digit must be evaluated at its own positional power of 2 before anything is summed.

The Math
Worked examples and deeper derivation

The formal conversion formula is a positional sum: for each digit at index i (counting from the right, starting at 0), the contribution to the decimal total is that digit multiplied by 2 raised to the power of i. Written as a sum, the decimal result equals the sum over all positions of (digit at position i) times (2 raised to the power of i).

For the example input 11010110, the bit count is 8 bits and the calculation proceeds position by position. Starting from the left (position 7 down to position 0): the first bit is 1 at position 7, contributing 128; the second is 1 at position 6, contributing 64; the third is 0 at position 5, contributing 0; the fourth is 1 at position 4, contributing 16; the fifth is 0 at position 3, contributing 0; the sixth is 1 at position 2, contributing 4; the seventh is 1 at position 1, contributing 2; the eighth is 0 at position 0, contributing 0. Summing the active contributions gives 214.

The key insight is that only the positions carrying a 1 matter. A long binary number with many zeros is often a small decimal number. Conversely, a short binary number with all 1s can be surprisingly large — an 8 bits-bit number with every position set to 1 would equal the sum of all powers of 2 from 0 through 7, which is 214 when one bit is unset, or 255 when all are set. That upper bound of 255 for a full byte is one of the most important numbers in computing.

Converting a short binary number — checking a network mask bit
Binary: 1010
The binary value 1010 converts to a decimal value of 10. Reading from right to left, position 0 holds a 0, position 1 holds a 1 (worth 2), position 2 holds a 0, and position 3 holds a 1 (worth 8). The two active bit positions contribute 8 plus 2, giving 10. A network engineer verifying a subnet mask would recognise this as the decimal representation of that particular bit pattern.
Converting a full byte — reading a pixel colour channel value
Binary: 11010110
The binary value 11010110 is 8 bits bits long — exactly one byte. Its decimal equivalent is 214. In an RGB colour system, each channel is stored as a single byte, so this bit pattern would represent a channel intensity of 214 out of a possible 255. The position breakdown shows contributions from the active bit positions: (1 × 2ⁱ7 = 128) + (1 × 2ⁱ6 = 64) + (1 × 2ⁱ4 = 16) + (1 × 2ⁱ2 = 4) + (1 × 2ⁱ1 = 2) = 214.
Edge case — a single set bit representing a pure power of two
Binary: 1
The binary value 1 is the simplest non-zero case: a single bit at position 0. Since 2 raised to the power of 0 equals 1, the decimal result is 1. This demonstrates the foundational rule of positional binary notation — the rightmost bit always carries a weight of 1 regardless of how many digits precede it. Programmers use this when checking the least significant bit of any integer.
Expert Unlock
The thing most explanations skip

The conversion formula assumes an unsigned integer, but real systems often store the same bit pattern with a different contract. In two's complement — the near-universal format for signed integers — a leading 1 bit signals a negative number, and the decimal value is computed by a different algorithm entirely. The same bit pattern 11010110 that this tool correctly reports as 214 would be interpreted as negative 42 in an 8-bit two's complement signed integer context. Knowing which representation applies is a precondition of meaningful conversion, and that context lives in the hardware or language spec, never in the bits themselves.

What does my binary number actually mean?

How do I convert binary to decimal by hand?

Write out the binary digits from left to right, then assign each digit a positional weight starting at 2 raised to the power of (bit count minus 1) for the leftmost digit and counting down to 2 raised to the power of 0 for the rightmost. Multiply each digit by its weight and sum the results. Only the positions holding a 1 contribute to the total — positions with a 0 add nothing. The tool shows this exact breakdown in the Position Breakdown output so you can follow along digit by digit.

Why does binary use base 2 instead of base 10?

Electronic circuits have two natural states — voltage present or voltage absent — which map directly onto 1 and 0. A base-2 system requires hardware to distinguish only two signal levels, making it far more reliable than a base-10 system that would need ten distinct voltage levels. Every number, instruction, and character a computer handles is ultimately stored and processed as a sequence of these two states. Decimal is the system humans read; binary is the system hardware executes.

What is the largest binary number I can convert?

JavaScript represents numbers as 64-bit floating-point values, which means integers are exact up to 2 raised to the power of 53 minus 1 — a decimal value of 9,007,199,254,740,991. In practice, a binary string of up to about 52 bits will convert without any precision loss. Beyond that length, rounding can creep in. For very large binary values used in cryptography or low-level hardware work, a dedicated big-integer library handles arbitrary precision more reliably than this tool.

Need something this doesn't cover?

Suggest a tool — we'll build it →