Binary to Decimal Converter — Read Base-2 Numbers as Base-10
Last updated:
Read a binary value as a regular base-10 number. Position weights are powers of two: the rightmost bit is worth 1, then 2, 4, 8, 16, and so on. This page treats the entire input as one unsigned integer (no 32-bit ceiling, no sign bit assumed).
Binary ⇄ Decimal Converter
How binary to decimal works
Each bit is multiplied by a power of two based on its position from the right. For 1010: 1·2³ + 0·2² + 1·2¹ + 0·2⁰ = 8 + 0 + 2 + 0 = 10. Whitespace inside the input is stripped before parsing, so 1010 and 0000 1010 give identical results.
Quick examples
| Binary | Decimal |
|---|---|
1010 | 10 |
11111111 | 255 |
10000000 | 128 |
1 0000 0000 | 256 |
1111111111111111 | 65535 |
How to use
- Paste binary digits into the Input box. Spaces and newlines between groups are ignored.
- The decimal value appears immediately in Output. No length cap — BigInt handles 64-bit, 256-bit, even 1000-bit inputs.
- Click Decimal → Binary at the top (or hit Swap) to reverse direction.
- Use Copy to grab the result. Conversion runs in your browser; nothing is uploaded.
Real-world use cases
- Parsing network protocol fields. Packet captures often display raw bits for length, flag, or TTL fields; converting them back to decimal makes the value match what the spec actually documents.
- CTF and reverse-engineering challenges. Flags and hidden numeric payloads frequently arrive as long bit strings. Dropping them straight into a base-2 reader is faster than writing a one-off script.
- Teaching positional notation. Showing
1010next to "8 + 2" is the cleanest way to demonstrate why a base is just a choice of column weights — and why digits past the radix never appear. - Inspecting memory dumps and registers. A debugger that prints
r0 = 10110100is easier to reason about once the value lands in decimal for mental arithmetic. - Reading bitwise-operation results. After applying AND, OR, or XOR to a value, the binary pattern shows you which bits flipped; the decimal form tells you what the new number is.
- Verifying hand-computed arithmetic. Classroom exercises that add or subtract in binary become trivially checkable by running both operands and the result through this converter.
From bits to numbers — how the conversion works
Every place in a binary number carries a positional weight — a power of two that grows by a factor of two each step to the left. The rightmost column is worth 2⁰ = 1, then 2¹ = 2, 2² = 4, 2³ = 8, and so on. To convert, multiply each bit by its column weight and add the results. For 1010 this is 1·8 + 0·4 + 1·2 + 0·1 = 10; for 11111111 it is 128 + 64 + 32 + 16 + 8 + 4 + 2 + 1 = 255. Nothing magical happens — it is the same algorithm that turns the decimal digits 347 into 3·100 + 4·10 + 7·1, only with base two instead of base ten.
The idea predates electronics. Gottfried Wilhelm Leibniz set out a full positional binary system in his 1703 paper "Explication de l'Arithmétique Binaire", complete with addition and multiplication tables. A century and a half later George Boole's 1854 Laws of Thought gave the algebra that operates on those two values, and Claude Shannon's 1937 master's thesis showed that the same algebra describes electrical switching circuits — the bridge from pure mathematics to working hardware. Every register read and integer parse since traces back to that sequence of insights.
One practical note: this tool does the addition in JavaScript BigInt, not the usual 64-bit float. Plain Number loses precision past 53 bits, which silently corrupts long bit strings; parseInt(str, 2) has the same problem. BigInt has no such ceiling, so a 1,024-bit input round-trips exactly. If you want to go the other way after converting, the decimal to binary converter uses the same arithmetic, and binary to hex covers base-16 when that is a tidier representation.
Worked examples
Four short conversions, each opened with the column-weight method:
1010 → 10 (the textbook case)
Four bits, weights 8-4-2-1: 1·8 + 0·4 + 1·2 + 0·1 = 8 + 2 = 10. This is the example most introductions start with because every column either contributes its full weight or nothing — no carries, no partial sums.
11111111 → 255 (8-bit maximum, unsigned)
Every bit set: 128 + 64 + 32 + 16 + 8 + 4 + 2 + 1 = 255. This is the largest value an unsigned byte can hold, and the reason RGB channels and many protocol fields top out at 255. A general shortcut: an N-bit unsigned field maxes out at 2N − 1.
10000000 00000000 00000000 00000000 → 2147483648 (32 bits, BigInt territory)
Just one bit set, in position 31 from the right: 2³¹ = 2,147,483,648. Note this is exactly one more than the signed-32-bit maximum (2³¹ − 1 = 2,147,483,647), which is why the same pattern means something very different in signed mode (see below). The BigInt backend handles even 1,024-bit inputs without losing a digit — that is the main reason this page does not use plain parseInt.
10000000 in signed 8-bit → −128 (two's complement)
Unsigned, 10000000 is simply 128. But tick the Signed (two's complement) box, pick 8-bit width, and the leading 1 becomes a sign bit: the value becomes −128. The same byte means two different numbers depending on how the surrounding code chose to interpret it — exactly why CPUs have separate "signed" and "unsigned" comparison instructions. The reverse direction is covered on decimal to binary, which can emit signed binary at any of the same bit widths.
Common pitfalls
- Treating binary as BCD. Binary-coded decimal stores one decimal digit per nibble:
0010 0111in BCD reads as "27", but in plain binary it is 39. This page does plain binary; if you have BCD, split into 4-bit groups and read each as a decimal digit. - Signed vs unsigned confusion.
11111111is 255 unsigned but −1 in 8-bit two's complement. Always check whether the source field was declareduint8orint8before deciding which result is "right". - Reading the bits backwards. Positional weights run right-to-left, just like decimal: the rightmost bit is the ones place. Flipping the order turns
1100(12) into0011(3) — a different number entirely. - Hitting Number precision limits. Plain JavaScript
NumberandparseInt(str, 2)silently lose accuracy past 53 bits. This tool sidesteps the problem by using BigInt; if you are converting in your own code, do the same or expect strange off-by-one results on long strings. - Counting separators as digits. The converter strips whitespace before parsing, so
1010and0000 1010behave identically. But commas, dashes, or0bprefixes are not whitespace — they will be rejected as non-binary characters. If your input is messy, head over to the binary code translator docs for a fuller breakdown of accepted formats.
Frequently asked questions
Is 1010 in binary equal to ten or one-thousand-ten?
In binary it is ten. Position weights are powers of two from the right: 1·8 + 0·4 + 1·2 + 0·1 = 10. The literal sequence "1010" only equals one-thousand-ten when interpreted in decimal.
Can this tool handle very large binary numbers?
Yes — internally it uses JavaScript BigInt, so a 1,000-bit binary string converts just fine. There is no 32-bit or 64-bit overflow ceiling.
How are negative binary values handled?
Plain binary has no built-in sign. By default this converter treats every input as an unsigned integer. Tick the Signed (two's complement) option and pick a bit width (8/16/32/64) to interpret the leading bit as a sign — for example, 11111111 reads as 255 unsigned but as -1 in 8-bit signed mode.
Do leading zeros change the decimal value?
No. 00001010 and 1010 both convert to 10. Leading zeros only affect bit-width, not the numeric value.
Why does my input get rejected as non-binary?
The input must contain only 0, 1, and whitespace. Letters, commas, or 0b/0x prefixes will be flagged. Strip them first or use the Hex → Binary tool if you actually have hex.
Why is binary 1010 equal to 10 in decimal and not 1010?
Because each column is worth a different amount. In decimal the columns are powers of ten (1, 10, 100, 1000); in binary they are powers of two (1, 2, 4, 8). Reading 1010 in base-2 means 1·8 + 0·4 + 1·2 + 0·1 = 10. The digit pattern looks identical, but the place values are completely different.
How big a binary number can this tool handle?
Arbitrarily big. The arithmetic runs through JavaScript BigInt, so there is no precision ceiling — you can paste a 256-bit hash, a 1,024-bit RSA modulus, or a multi-thousand-bit string and the decimal output is exact. The only practical limit is the 100,000-character input cap shared across the site.
What is the difference between signed and unsigned conversion?
Unsigned reads every bit as a positive value: 8 bits cover 0 through 255. Signed (two's complement) reserves the leftmost bit as the sign — the same 8 bits then cover -128 through 127, with anything starting with 1 being negative. Switch modes when your data comes from a CPU register, an int8/int16/int32 field, or any source that can represent negatives.