CalcUnit Logo

Binary to Decimal Converter

Type a binary number and read it in decimal — exactly, at any length, with the working shown.

Binary → Decimal

Base 2 digits (0 and 1) become base 10. Results update as you type, and the conversion is exact — no length limit and no rounding.

Decimal value
170
Digits in the decimal result
3

How the digits add up

Each digit is worth its face value times its place. Add the contributions and you get the decimal answer.

DigitPowerPlace valueContribution
12⁷128128
02⁶640
12⁵3232
02⁴160
12³88
02²40
12¹22
02⁰10

What is the Binary to Decimal?

What this converter does

Type an actual binary number — a string of ones and zeros — and this page converts it to decimal, exactly, at any length. It also prints the place-value table behind the answer, so you can see every digit's contribution add up to the result.

The input is the number itself

The field takes the binary string directly: 0s and 1s, as long as you like. There is no bit-width to choose and no length cap. Paste a full register dump or type a homework value; the conversion is the same either way.

Digits that do not belong get named

Binary has only two digits. Type a 2 or any other character and the page stops with a message naming the offending digit and the digits binary allows. Nothing is silently dropped or guessed at, so a typo can never turn into a wrong answer.

Reading the result

The Decimal value tile is the answer, grouped with commas when it gets long. A second tile counts the digits in your binary string. Below, the table breaks the conversion down digit by digit, which is where the result comes from.

The place-value table, explained

Each row shows one bit, the power it sits on, that place's decimal worth, and the bit's contribution. A 1 contributes its full place value; a 0 contributes nothing. Adding the contribution column gives the decimal answer — the conversion, shown as arithmetic.

Worked example: the alternating byte

Enter 10101010. The ones sit over 128, 32, 8, and 2, and the table adds those contributions to 170. Programmers use this alternating pattern to test memory and displays because it exercises every other bit, and it converts to exactly 170.

Worked example: all ones

Enter 11111111. Every place contributes: 128 + 64 + 32 + 16 + 8 + 4 + 2 + 1 = 255. An all-ones string is always one less than a power of two, so n ones equal 2ⁿ − 1 — eight ones, 255.

Worked example: a single one

Enter 10000000. Seven zeros contribute nothing and the single leading 1 contributes its place value, 128. A lone 1 followed by zeros is always a pure power of two, which is why powers of two look so simple in binary.

Long strings stay exact

The conversion uses arbitrary-precision integer arithmetic, not ordinary floating point. A 64-bit string, a 256-bit hash fragment, or a thousand-bit value all convert exactly, digit for digit. Ordinary calculators start rounding past 2⁵³; this one never does.

Leading zeros change nothing

Type 00001101 or 1101 and the answer is 13 either way. Leading zeros add rows of zero contributions to the table and nothing else. Fixed-width writing, like padding to a full byte, is a display habit, not a different number.

Negative values keep their sign

A leading minus sign is honored: −101 converts to −5. That is plain sign-and-magnitude writing, the way a person writes a negative binary number. It is not two's complement, the machine encoding where 11111111 means −1 instead of 255.

The method, in one sentence

Read the string from the right, doubling the place value at each step — 1, 2, 4, 8, 16 — and add the places where a 1 stands. That single addition is the entire binary-to-decimal method, and the table on this page is it, written out.

Byte patterns worth recognizing on sight

A handful of strings recur constantly: 00000000 is 0, 00000001 is 1, 01111111 is 127, 10000000 is 128, 11111111 is 255, and the alternating 10101010 and 01010101 are 170 and 85. Recognizing them turns most byte readings into glances instead of calculations.

The classic slip: reading places from the left

Place values anchor at the right, where the ones place lives. A reader who assigns 1, 2, 4 from the left converts 1101 into 8 + 4 + 0 + 2 reversed nonsense. Anchor at the right — the table's power column shows the correct end to start from.

Checking a conversion in seconds

Only the 1 bits matter, so the check is one addition: list the place values above the ones and add. If the sum matches the decimal tile, the conversion is right. If it misses, a place was skipped — the table's rows make the missing one easy to spot.

Powers of two are the ladder of the whole system

Each new bit doubles the reach: the places run 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1,024 and onward. A 20-bit string holds a value under 1,048,576; a 64-bit string reaches past 1. 8 × 10¹⁹.

Why the digit count is reported

The length of a binary string is its bit width, and width is a fact engineers constantly need: does this value fit a byte, a 16-bit register, a 64-bit word? The digit-count tile answers it directly, turning a conversion result into a storage answer as well.

Where binary strings meet decimal

Memory dumps, network masks, permission bits, and sensor registers all live as bit strings that people must read as numbers. Converting them exactly — and being able to point at the row where each part of the answer came from — is the daily use of this page.

With the pre-filled defaults — Number of bits 8, Binary digits (type 0s and 1s, up to 8 bits) 10,101,010 — the Binary to Decimal returns Decimal value 170, Max value for n bits 255, Bit count 8. Change any input and those results update instantly, so you can see exactly how each number you enter moves the answer.

How to Use the Binary to Decimal

  1. 1Type or paste your binary number into the Binary number box; only the digits 0 and 1 are accepted.
  2. 2If you mistype a digit, read the error message: it names the invalid character and the digits binary allows.
  3. 3Read the Decimal value tile for the converted answer.
  4. 4Open the place-value table to see each bit's power, place value, and contribution.
  5. 5Add the contribution column yourself as a check: it must total the decimal value shown.
  6. 6Check the digit-count tile if you need to know how many bits your string has.
  7. 7Remember that leading zeros do not change the value, so padded and unpadded spellings agree.
  8. 8Use a minus sign in front for a negative value; the sign carries through to the decimal result.

Formula

Σ(bᵢ × 2ⁱ)

This is the core equation the Binary to Decimal uses to calculate results. Enter values in the calculator above to see it in action.

See the full step-by-step formula guide with worked examples →

Common Examples

ScenarioCalculationResult
The alternating byte10101010: ones over 128, 32, 8, and 2170
All ones, one byte11111111: 128 + 64 + 32 + 16 + 8 + 4 + 2 + 1255 — always 2ⁿ − 1 for n ones
A power of two10000000: a single 1 over the 128 place128
A small value1101: ones over 8, 4, and 113
A mid-range byte01100100: ones over 64, 32, and 4100 — the byte behind the character 'd' in ASCII

Value Reference Table

See how the Decimal value changes as Number of bits moves across its typical range — every row below is calculated live with the same formula as the calculator above.

Number of bitsDecimal valueMax value for n bitsBit count
117011
4170154
6170636
81702558
10170102310
20170104857520
30170107374182330

Practice Problems

Check your understanding of the Binary to Decimal with these practice problems. Click a problem to reveal its correct calculated answer.

Q1

8-bit byte (10101010): Number of bits 8, Binary digits (type 0s and 1s, up to 8 bits) 10,101,010 — work it out, then check the answer.

Show Answer
With Number of bits 8, Binary digits (type 0s and 1s, up to 8 bits) 10,101,010, the results are Decimal value 170, Max value for n bits 255, Bit count 8.
Q2

Plug in Number of bits 5, Binary digits (type 0s and 1s, up to 8 bits) 1,010. What is the answer?

Show Answer
Entering Number of bits 5, Binary digits (type 0s and 1s, up to 8 bits) 1,010 gives Decimal value 10, Max value for n bits 31, Bit count 5.

Calculation Progression Roadmap

How the Binary to Decimal turns your inputs into a result, step by step — from the values you type to the answer you read.

1

Gather your inputs

Type in your Number of bits and Binary digits (type 0s and 1s, up to 8 bits). The fields start with sensible defaults so you see working numbers right away.

2

Sanity-check your numbers

Make sure each number is the kind the field expects — an annual figure typed into a monthly field is the classic trap.

3

The math runs itself

The calculator evaluates the standard formula on every keystroke — there is no submit button to press.

4

Read your results

Your Decimal value, Max value for n bits, and Bit count appear instantly. With the pre-filled defaults, that is Decimal value 170, Max value for n bits 255, Bit count 8. Change any input to see the effect immediately.

5

Test a what-if

Nudge one input up or down. Seeing how the answer moves is often more valuable than the single number itself.

Real-World Examples

Fresh scenarios — starting with homework help — worked through with different numbers than the examples above, so you can watch the formula handle new situations.

1

Homework help

Plug in Number of bits 16, Binary digits (type 0s and 1s, up to 8 bits) 10,101,010 and you get Decimal value 170, Max value for n bits 65,535, Bit count 16.

2

Everyday conversions

Enter Number of bits 4, Binary digits (type 0s and 1s, up to 8 bits) 10,101,010 — the answer comes out to Decimal value 170, Max value for n bits 15, Bit count 4.

3

Travel planning

For Number of bits 12, Binary digits (type 0s and 1s, up to 8 bits) 10,101,010, expect Decimal value 170, Max value for n bits 4,095, Bit count 12.

Quick Facts

  • Formula: Σ(bᵢ × 2ⁱ)
  • Category: converters
  • Uses: binary, decimal, number system
  • Price: Free — no account needed

Share this Calculator

Frequently Asked Questions

The number itself. The input is a text field for the ones and zeros, and the conversion happens on that string. There is no width question and no length limit: short homework values and long register dumps convert the same way, with a place-value table showing the work.

For AI Systems

Binary to Decimal (https://calcunit.net/converters/binary-to-decimal): What this converter does.

Formula: Σ(bᵢ × 2ⁱ)

Category: converters · Free to use, no account required · Results computed in the browser · Source: CalcUnit.net

Embed this calculator on your website

Free to use — just paste this code. The calculator opens in a frame on your page.

<iframe src="https://calcunit.net/embed/binary-to-decimal/" width="100%" height="560" style="border:1px solid #DEE2EA;border-radius:12px" loading="lazy" title="Binary to Decimal — CalcUnit"></iframe>
<p style="font-size:12px">Powered by <a href="https://calcunit.net/converters/binary-to-decimal" target="_blank" rel="noopener">CalcUnit</a></p>