toolqik

90 · Encode & Convert

Binary to Decimal

Convert binary numbers to decimal, including fractions and signed two’s complement.

Runs in your browser
Format
Result

  

About this tool

Convert binary (base 2) numbers to decimal (base 10). Paste one binary number per line; spaces, underscores and 0b prefixes are ignored, so 1111 1111 and 0b1111_1111 both give 255.

How to convert binary to decimal

Each binary digit is worth a power of two, doubling from right to left: 1, 2, 4, 8, 16… Add up the values of the positions that contain a 1:

1  1  0  1
8  4  2  1   →  8 + 4 + 1 = 13

After a binary point, positions are worth ½, ¼, ⅛…, so 101.11 = 4 + 1 + 0.5 + 0.25 = 5.75.

Signed numbers (two’s complement)

11111011 is 251 as an unsigned byte, but −5 as a signed 8-bit integer. Choose a bit width under Negative numbers to read inputs of exactly that length as two’s complement: if the first bit is 1, the value is negative.

Features

  • Any size: numbers are converted exactly with arbitrary-precision arithmetic, so 64-bit values and even longer numbers never lose digits (a normal calculator rounds anything above 253).
  • Fractions: 3.75 → 11.11. Fractions that don’t end in the target base, like 0.1 in binary, are cut off after the chosen number of digits and marked with ….
  • Negative numbers with a minus sign, or as two’s complement in 8, 16, 32 or 64 bits, the way computers store signed integers.
  • Flexible input: prefixes (0b, 0o, 0x, #), spaces, underscores and thousands separators are ignored. Convert many numbers at once, one per line.
  • The first number is also shown in every base, with the number of bits it needs.

Quick reference

DecimalBinaryOctalHex
0000
1111
21022
31133
410044
510155
711177
81000108
91001119
10101012A
15111117F
16100002010
321000004020
64100000010040
100110010014464
12711111111777F
1281000000020080
25511111111377FF
256100000000400100
1024100000000002000400

FAQ

How do I convert binary to decimal?

Enter the binary number and the decimal value appears instantly. By hand, add the powers of two (1, 2, 4, 8…) for every position that holds a 1, counting from the right.

What is 1010 in decimal?

10. 11111111 is 255, and 10000000 is 128.

How do I convert a signed binary number?

Choose the bit width (8, 16, 32 or 64) under Negative numbers. Inputs of exactly that length starting with 1 are read as negative two’s complement values, so 11111011 is −5.

Can I convert binary fractions?

Yes. 101.11 converts to 5.75; each position after the point is worth half the previous one.

esc
↑↓ navigate↵ open