Binary to Decimal Converter_
Type a binary number and watch it become decimal — with every step of the place-value method printed below the answer, the way a teacher would write it on the board. The 0b prefix, spaces, and underscores are all fine, and long values stay exact because the math is big-integer.
Homework says one thing, the datasheet another? The Signed toggle re-reads those same bits as a signed field, from a single byte upwards — where 11111111 stops being 255 and becomes −1.
- Input
- A run of ones and zeros — a byte from a datasheet, a register value, a homework question, a permission mask.
- Output
- The decimal number, with each bit’s place value written out and added up, so the answer arrives with its working rather than on its own.
- Processing
- Worked out in this tab with BigInt arithmetic, so a 200-bit value is exact rather than rounded to the nearest double.
- Limits
- No ceiling on the number of bits. A character that is not 0 or 1 is named with its position instead of being skipped.
- Signed values
- The same bits mean 255 or −1 depending on whether the field is signed, and only the data format decides which. Both readings are shown together rather than one being guessed for you.
Binary to decimal, taught the way it's actually done
The place-value method, step by step
How to convert binary to decimal: write the place values over the bits, right to left — 1, 2, 4, 8, 16, doubling each time — then add up the places where a 1 sits. Zeros contribute nothing, so you can skip them entirely. Take 11010110: ones sit on the 128, 64, 16, 4, and 2 places, and 128 + 64 + 16 + 4 + 2 = 214. That's the whole method. Type the same value above and the working panel prints these exact rows, so you can translate binary to decimal by hand and check every line of your arithmetic against the tool's.
The doubling shortcut
The second method schools teach trades powers for a running total: start at the leftmost bit with 0, and for each bit, double your total and add the bit. On 11010110: 1, 3, 6, 13, 26, 53, 107, 214. No powers of two to memorize, and it's the faster mental method for long values — each step is one doubling and maybe a +1. Both routes land on 214, which makes the pair a built-in cross-check for exams: run the place-value sum first, confirm with doubling, and a mismatch means a slipped bit.
Signed binary — when the first bit is a sign
How to convert signed binary to decimal: in two's complement, a leading 1 makes the value negative, and the rule is invert every bit, add one, and put a minus sign on the result. 11111111 → invert → 00000000 → add one → 1 → so the value is −1. The Signed toggle above applies that rule at whatever field width the data really uses, inferring it from the bit count unless you pick one, and keeps the unsigned reading — 255 — visible beside it, because whether those eight ones mean 255 or −1 is a fact about the data format, not about the bits.
In Excel, in Python, and back again
Excel's =BIN2DEC(11010110) handles this conversion — up to 10 bits only, with the tenth bit acting as a sign, so =BIN2DEC(1111111111) is −1 and anything longer errors out. Python has no such ceiling: int("11010110", 2) or the literal 0b11010110 both give 214 at any length. And for binary to decimal and vice versa, this page pairs with the decimal to binary converter — the top-right link swaps direction without retyping anything.
Type the bits and watch the place values add up
- 01Enter the binary number — bare, 0b-prefixed, or grouped with spaces or underscores. The conversion to binary to decimal happens as you type, like a binary to decimal calculator with no convert button.
- 02Read the decimal answer, the hexadecimal equivalent below it, and the place-value working — each 1-bit’s contribution listed and summed, which is the part homework actually asks you to show.
- 03Reading raw bytes or registers? Turn on Signed (two’s complement) and pick the width; this binary to decimal translator then shows both the signed and unsigned readings at once.
- 04Copy_Result for the decimal, or jump to the reverse converter with the Decimal → binary link when the assignment flips direction.
Four conversions people actually need
Homework, with the working shown
The assignment wants the answer AND the method. The working panel prints each 1-bit's place value and the sum — the exact lines to copy into your solution.
10110
1 × 2^4 = 16 1 × 2^2 = 4 1 × 2^1 = 2 = 22
Subnet mask octet
A /26 network's last mask octet is 11000000. Converting it confirms the dotted-decimal form you'd type into a config.
11000000
192 → mask ends .192
Permission bits
rwxr-xr-- as bits is 111 101 100. Each triplet converts to one chmod digit.
111 · 101 · 100
7 · 5 · 4 → chmod 754
The sensor byte that reads wrong
A temperature register returns 11110110. Unsigned that's 246 — but the datasheet says signed, and at 8-bit two's complement it's −10.
11110110
-10 · unsigned: 246
Place values — the numbers to memorize
| Position | Place value | Position | Place value |
|---|---|---|---|
| 2⁰ | 1 | 2⁸ | 256 |
| 2¹ | 2 | 2⁹ | 512 |
| 2² | 4 | 2¹⁰ | 1,024 |
| 2³ | 8 | 2¹¹ | 2,048 |
| 2⁴ | 16 | 2¹² | 4,096 |
| 2⁵ | 32 | 2¹³ | 8,192 |
| 2⁶ | 64 | 2¹⁴ | 16,384 |
| 2⁷ | 128 | 2¹⁵ | 32,768 |
Two landmarks past the table: 2³¹ = 2,147,483,648 (where 32-bit signed values run out) and 2⁶³ = 9,223,372,036,854,775,808 (the 64-bit edge). The first eight rows cover every byte question you'll ever get.
Binary ↔ decimal — small values and common bytes
| Binary | Decimal | Binary | Decimal |
|---|---|---|---|
0 | 0 | 1000 | 8 |
1 | 1 | 1001 | 9 |
10 | 2 | 1010 | 10 |
11 | 3 | 1011 | 11 |
100 | 4 | 1100 | 12 |
101 | 5 | 1101 | 13 |
110 | 6 | 1110 | 14 |
111 | 7 | 1111 | 15 |
10000 | 16 | 10101010 | 170 |
11000000 | 192 | 11111111 | 255 |
10101010 (170, 0xAA) and its complement 01010101 (85, 0x55) are the alternating test patterns of memory diagnostics; 255 is every bit of a byte set.
Converting by hand without losing your place
- Only the 1-bits matter — cross out the zeros first and the sum gets shorter. 10000001 is just 128 + 1.
- Cross-check exam answers with both methods: place-value sum going right-to-left, doubling going left-to-right. Agreement means the answer is safe to box.
- Leading zeros never change the value — 00101 and 101 are both 5. Padding to 8 bits is formatting, not arithmetic.
- Group long binary in fours or eights (spaces or underscores work here) — misread bits, not bad math, cause most wrong answers.
- If a register value looks absurdly large, try the Signed toggle before doubting the hardware — a leading 1 on signed data flips the meaning entirely.
- Verify any other converter with a 54-bit value like 2⁵³+1 — float-based tools round it; this one is exact and tested on precisely that value.
When the same bits mean two different numbers
The same bits, two different numbers
Unsigned or two’s complement is a choice the bit pattern cannot express. 11110110 is 246 or −10 depending on what the format says. Datasheets and file specs state it; when a reading makes no physical sense, the sign convention is the first suspect.
Why 11111111 is −1 and not 255
At 8-bit two’s complement, values wrap: the pattern for −1 is the one that rolls over to zero when you add 1, and all-ones does exactly that. Invert (00000000), add one (1), negate: −1. It’s the same trick an odometer plays rolling back from 000000.
Leading zeros are harmless — until they imply width
00101 equals 101 as a number. But in a signed context, width matters: 1111 as a 4-bit signed value is −1, while 00001111 at 8 bits is +15. When sign is in play, the padding IS information — that’s why the Signed toggle asks for a width.
Binary digits are not binary-coded decimal
BCD stores each decimal digit in its own 4-bit group: 0100 0111 in BCD means the digits 4 and 7 — the number 47 — while the same bits read as one binary number are 71. Old instruments and RTC chips speak BCD; convert nibble by nibble there, not as one value.
Float-based tools break past 53 bits
A binary string longer than 53 bits exceeds what double precision can hold, which is why a 64-bit register value comes back wrong from so many converters. A double-precision number stops holding every integer past 9,007,199,254,740,991, so converters that compute in floats emit plausible wrong answers above it. The arithmetic here is arbitrary-precision, and the first integer a double cannot represent — 9,007,199,254,740,993 — is pinned in the test suite.
Digits, widths and exactness
- Input
0b-prefixed or bare, with an optional sign and spaces or underscores between groups. Input is capped at 10,000 digits — far past any real register, address or identifier, and short enough that a mispaste cannot lock up the tab.- Working panel
- Place-value rows for every 1-bit with the running sum, shown for values up to 10 bits — the show-your-work half of the answer
- Arithmetic
- Big-integer end to end; the 2⁵³+1 rounding boundary is a pinned test case
- Signed mode
- Two's complement at 8/16/32/64 bits or Auto (width from bit count); unsigned reading shown alongside; over-width input reports the bits it needs
- Readouts
- Decimal primary with optional thousands grouping; hexadecimal secondary
- Errors
- The offending character named with a caret at its exact position; fractional input explained rather than truncated
- Shared component
- The same converter component serves the hex and decimal directions — one implementation, four pages
- Network
- None from tool code. A test sweep calls every function this page uses with
fetchandXMLHttpRequestreplaced by stubs that throw, so a stray request fails the build instead of shipping. Disconnect from the network and the page still works.
Questions about converting binary numbers
What is the easiest way to convert binary to decimal?
For short values, place values: write 1, 2, 4, 8… under the bits right-to-left and add where the 1s are. For long values, doubling: start left with 0, double and add each bit. Both are taught above with the same worked example so you can pick whichever sticks.
What is 11111111 in decimal?
As an unsigned byte, 255 — all eight place values summed. As an 8-bit two’s-complement signed byte, −1. The Signed toggle shows both at once; which one is "right" depends on the format that produced the byte.
How do I convert binary to decimal in Python or Excel?
Python: int("11010110", 2) → 214, any length, always exact. Excel: =BIN2DEC(11010110) — but only up to 10 bits, and the tenth bit is a sign, so long or signed values need this page or workarounds.
Does it handle binary fractions like 101.1?
No — whole numbers only, and the error says so rather than silently cutting at the point. (101.1 would be 5.5: fractional places continue halving — ½, ¼ — to the right.) Fractional binary is rare enough outside coursework that guessing would hurt more than help.
How big a binary number can it convert?
Ten thousand digits, and every one of them exactly — the working never rounds. The landmark worth remembering is 53 bits, which is where ordinary calculators quietly start lying.
Is this the same as converting binary to text?
No — that’s the neighbouring binary to text translator, which reads bytes as characters. This page answers "what number is this"; that one answers "what does this say". 01000001 is 65 here and the letter A there.