Skip to content

Binary to Decimal Converter

Convert binary numbers to decimal (base-10). Paste a value like 10110 or 11010001 and this binary to decimal converter shows the result and the place-value working.

Runs in your browser Free, no sign-up
Loading tool workspace...

What is Binary to Decimal Converter?

This binary to decimal converter turns base-2 numbers into ordinary base-10 integers, known as denary in UK classrooms. Each position in a binary number is a power of two, doubling from right to left (1, 2, 4, 8, 16 …), and the decimal value is the sum of the positions that hold a 1: 101101 is 32 + 8 + 4 + 1 = 45.

Paste one binary number or several separated by spaces, and each is converted instantly. For a single value, a summary shows it in every base at once, binary, octal, decimal and hex, plus the ASCII character it represents, which is handy for learning and debugging.

How to use Binary to Decimal Converter

  1. Enter a binary number, or several separated by spaces or commas, for example 101101
  2. Read the decimal result.
  3. For a single value, check the summary in octal, hex and ASCII.
  4. Copy the result, or click Swap to convert decimal to binary.

Key features

  • Convert many values at once, separated by spaces or commas
  • Exact results for numbers of any size, including 64-bit values
  • Output separated by spaces, commas, new lines or nothing
  • Uppercase or lowercase hex, optional 0x prefix, and binary padded to whole 8-bit bytes
  • Swap button to reverse the conversion direction
  • Summary of a single value in binary, octal, decimal, hex and ASCII
  • Clear errors for invalid digits; runs entirely in your browser

Common use cases

  • Learning and checking binary arithmetic for computer science classes
  • Reading flag and register values in embedded systems
  • Converting bytes from network captures into decimal
  • Interpreting subnet masks and IP address octets
  • Decoding binary values from puzzles and CTF challenges

Technical details & standards

Each bit is multiplied by 2 raised to its position, counting from 0 on the right, and the results are added: 1101 = 1×8 + 1×4 + 0×2 + 1×1 = 13. An 8-bit byte ranges from 0 (00000000) to 255 (11111111). In general, n bits hold 0 to 2ⁿ − 1, so 10 bits reach 1023 and 16 bits reach 65,535.

Values separated by spaces or commas are converted individually, and a 0b prefix is accepted. A continuous bit string is one number of any length, so 0000000100000001 gives 257; to decode bytes separately, put spaces between them (00000001 00000001 gives 1 1). The arithmetic uses arbitrary-precision integers, so 64-bit and longer values are exact, and a leading minus sign gives a negative number.

How to calculate binary to decimal: 10011101 step by step

Bin to dec is addition: write the place values over the bits and add the ones under a 1. For an 8-bit number the place values are 128, 64, 32, 16, 8, 4, 2 and 1.

  1. Line up the bits of 10011101 under 128, 64, 32, 16, 8, 4, 2, 1.
  2. The 1s fall under 128, 16, 8, 4 and 1; the 0s under 64, 32 and 2 count for nothing.
  3. Add the place values under the 1s: 128 + 16 + 8 + 4 + 1.

Result: 10011101 in binary is 157 in decimal (denary). Type it into the converter to see the same working with powers of two.

Binary to decimal in JavaScript and Python

Both languages parse a string of bits in one call; a 0b prefix marks a binary literal.

JavaScript

parseInt("10011101", 2); // 157
Number("0b1001");         // 9
0b11110;                  // 30, a binary literal

Python

int("10011101", 2)  # 157
int("0b1001", 0)    # 9, base 0 reads the prefix
0b11110             # 30

# Signed (two's complement) value of a fixed-width bit string
def signed(bits):
    n = int(bits, 2)
    return n - (1 << len(bits)) if bits[0] == "1" else n

signed("11111110")  # -2

Binary to decimal conversion table

Every 4-bit pattern, then every 5-bit number from 10000 to 11111, so the values 0 to 31 are all here in order. The last table lists the powers of 2 up to 2¹⁶: to convert any longer binary number, add the powers for the positions that hold a 1.

4-bit binary patterns in decimal

BinaryDecimalHex
000000
000111
001022
001133
010044
010155
011066
011177
100088
100199
101010A
101111B
110012C
110113D
111014E
111115F

5-bit binary numbers (10000 to 11111) in decimal

BinaryDecimalPlace values added
100001616
100011716 + 1
100101816 + 2
100111916 + 2 + 1
101002016 + 4
101012116 + 4 + 1
101102216 + 4 + 2
101112316 + 4 + 2 + 1
110002416 + 8
110012516 + 8 + 1
110102616 + 8 + 2
110112716 + 8 + 2 + 1
111002816 + 8 + 4
111012916 + 8 + 4 + 1
111103016 + 8 + 4 + 2
111113116 + 8 + 4 + 2 + 1

Powers of 2 used in binary conversion

PowerDecimalBinaryWhere you see it
2⁰11Bit 0, the rightmost position
2¹210
2²4100
2³81000
2⁴161 0000
2⁵3210 0000
2⁶64100 0000
2⁷1281000 0000The leftmost bit of a byte
2⁸2561 0000 0000Number of values one byte can hold
2⁹51210 0000 0000
2¹⁰1,024100 0000 00001 KiB
2¹¹2,0481000 0000 0000
2¹²4,0961 0000 0000 00004 KiB, a common memory page size
2¹³8,19210 0000 0000 0000
2¹⁴16,384100 0000 0000 0000
2¹⁵32,7681000 0000 0000 0000The leftmost bit of a 16-bit number
2¹⁶65,5361 0000 0000 0000 0000Number of values 16 bits can hold

Frequently asked questions

How do I convert binary to decimal?

Write the powers of two above the bits from right to left (1, 2, 4, 8, …) and add the ones under each 1. For 10010: 16 + 2 = 18.

What is 11111111 in decimal?

255: 128 + 64 + 32 + 16 + 8 + 4 + 2 + 1. It is the largest value an 8-bit byte can hold.

What is 1010 in decimal?

10: 8 + 2. In binary, 1010 is the number ten.

How do I convert binary to decimal in code?

JavaScript: parseInt("101101", 2). Python: int("101101", 2). Both return 45.

What is the binary to decimal formula?

decimal = bₙ×2ⁿ + … + b₂×2² + b₁×2¹ + b₀×2⁰, where each b is a bit (0 or 1) and positions count from 0 on the right. For 1101: 1×8 + 1×4 + 0×2 + 1×1 = 13.

What is 10110 in decimal?

10110 in binary is 22 in decimal: 16 + 4 + 2 = 22.

How do I convert 11010001 to a denary value?

11010001 is 209: 128 + 64 + 16 + 1 = 209.

What is 101 in decimal?

101 is 5: 4 + 0 + 1 = 5.

What is 11110 in decimal?

11110 is 30: 16 + 8 + 4 + 2 + 0 = 30.

What is the largest 10-bit number in decimal?

1023. Ten bits all set to 1, 1111111111, add up to 512 + 256 + 128 + 64 + 32 + 16 + 8 + 4 + 2 + 1 = 1023, which is 2¹⁰ − 1. So 10 bits can store 1,024 different values, from 0 to 1023.

Do leading zeros change a binary number, as in 0101 or 010?

No. Leading zeros only pad the number to a fixed width, so 0101 is 101, which is 5, and 010 is 10, which is 2. They matter only when you are reading fixed-size fields such as bytes, where 00000101 tells you all eight bits.

What are 1001 and 1101 in decimal?

1001 is 8 + 1 = 9, and 1101 (sometimes written 1101₂ to show the base) is 8 + 4 + 1 = 13. Both are four bits, so each is also a single hex digit: 9 and D.

How do I convert signed binary to decimal?

Signed binary usually means two's complement: if the leftmost bit of the fixed-width value is 1, the number is negative, and its value is the unsigned value minus 2 to the power of the width. In 8 bits, 11111110 is 254 − 256 = −2 and 10000000 is −128, while 01111111 stays 127. This converter reads bits as an unsigned number, so it shows 11111110 as 254; apply the subtraction yourself, or use the snippet in the code section.

More converters tools

View all