Binary Code to Decimal

Convert binary to an unsigned decimal integer, or swap to convert decimal back to binary. This is number conversion, not character decoding. BigInt preserves integer precision within the input and browser limits.

Reviewed · Binary Code Translator project · Free to use
On this page
LIVE CONVERTER Runs in this browser

01

Add the positions that contain 1

Starting at the right, positions are worth 1, 2, 4, 8, and successive powers of two. For 101101, the positions worth 32, 8, 4, and 1 are set. Their sum is 45.

101101 in base 2 equals 45 in base 10
Position from rightBitPlace valueContribution
513232
40160
3188
2144
1020
0111
02

Convert decimal back to binary

Repeatedly divide by two and record the remainders. For 13: 13 ÷ 2 gives 6 remainder 1; 6 ÷ 2 gives 3 remainder 0; 3 ÷ 2 gives 1 remainder 1; 1 ÷ 2 gives 0 remainder 1. Read upward to get 1101.

Swap uses the valid result as the new input. Leading zeroes do not affect the unsigned value and are not restored: 00000101 becomes 5, then 101.

03

Check an exact 64-bit result

Sixty-four ones represent 2⁶⁴ − 1, or 18446744073709551615. Paste the example below to check the full value. JavaScript's ordinary Number type cannot represent every integer this large; this tool uses BigInt instead.

BigInt avoids floating-point rounding, but not memory limits. Input fields accept at most 20,000 UTF-16 code units, including separators.

Exact unsigned integer examples
BinaryDecimal
1015
11111111255
111111111111111111111111111111111111111111111111111111111111111118446744073709551615
04

Know what this number does not say

11111111 is 255 as an unsigned integer, but −1 under eight-bit two's complement. A signed reading requires an agreed format and bit width; this converter does not infer them.

Negative integers, fractions, decimal points, and scientific notation are outside its scope. If you expect a word, use a text decoder. The unsigned value of 01000001 is 65; only an ASCII or UTF-8 interpretation makes it A.

Frequently asked questions

What is 101 in decimal, and how is it calculated?

As an unsigned binary integer, 101 equals decimal 5: 1 × 4 + 0 × 2 + 1 × 1. Each position is a power of two, starting with 1 on the right. This is a numeric interpretation; the same three digits are not a complete ASCII or UTF-8 text group.

Permalink
How do I convert decimal back to binary?

Use Swap to switch to decimal input, then enter an unsigned whole number. For example, decimal 13 becomes 1101. By hand, repeatedly divide by two and read the remainders from last to first. The converter returns an integer's bits, not the ASCII bytes of its printed decimal digits.

Permalink
Are leading zeroes or a fixed bit width preserved?

No. Leading zeroes do not change an unsigned integer's value, and decimal-to-binary output uses the shortest representation. Thus 00000101 becomes 5, and converting back produces 101. Zero is written as 0. Record the original width separately if a protocol or exercise requires an eight-, sixteen-, or other fixed-width field.

Permalink
Can this converter handle 64-bit numbers without rounding?

Yes. It uses BigInt for exact integer conversion: 64 binary ones equal 18446744073709551615. It does not pass that value through floating-point arithmetic. Exactness is still subject to practical input and browser-memory limits; the input field allows up to 20,000 UTF-16 code units, including separators, rather than unlimited data.

Permalink
Can I include spaces, commas, underscores, or a 0b prefix?

Spaces, commas, and underscores are removed in both number-conversion directions. For example, binary 1111_0000 becomes decimal 240, and decimal 1,000 becomes binary 1111101000. Separators do not create a list of separate values. A 0b prefix, signs, decimal points, and scientific notation are not accepted; enter the digits of one unsigned integer.

Permalink
Does this support signed binary, two's complement, or fractions?

No. This converter reads unsigned whole numbers only. For example, 11111111 is 255 here, whereas an eight-bit two's-complement interpretation gives −1. Signed values require a specified representation and bit width; fractions require rules for the fractional positions. The tool does not infer either format from the digits.

Permalink
Why does 01000001 produce 65 instead of A?

The number converter adds binary place values, so 01000001 becomes the unsigned integer 65. A text decoder then needs an encoding such as ASCII to map that value to A. If your source is a word or sentence, use the text decoder; converting the whole message as one number loses its character boundaries.

Permalink

Sources & verification

Reference material used for this explanation. The examples are reproducible with the tools on this site; see how they are checked.

Found a mismatch? Send a correction with a source.