Binary Calculator & Converter

Share calculator:
Embed this tool:

Use it as a converter between binary, decimal and hexadecimal, or switch to calculator mode to add, subtract, multiply and divide two binary numbers.

Binary numbers explained

Binary is the base-2 number system. Where decimal uses ten digits, binary uses only two, 0 and 1, called bits. Each position is worth a power of two instead of a power of ten. Reading from the right, the places are worth 1, 2, 4, 8, 16, 32 and so on, so the binary number 1011 means 1 × 8 + 0 × 4 + 1 × 2 + 1 × 1 = 11.

Digital hardware stores everything as binary because a circuit that is either on or off is simple to build and easy to read reliably. People who work with hardware and low-level code usually write binary values in hexadecimal (base 16) as shorthand, since one hex digit covers exactly four bits and a byte is always two hex digits.

The same numbers in decimal, binary and hex
DecimalBinaryHex
000
111
2102
51015
810008
101010A
151111F
161000010
31111111F
64100000040
100110010064
25511111111FF
256100000000100
1,00011111010003E8

How to use the binary calculator and converter

Choose Converter or Calculator with the Select tool buttons at the top.

  • Converter: pick one of Binary to Decimal, Decimal to Binary, Binary to Hex or Hex to Binary, type the number and press Convert.
  • Calculator: type a binary number, choose add, subtract, multiply or divide from the operator menu, type a second binary number and press the button. The answer is shown in binary and in decimal.

A few rules apply to what you can type:

  • Binary input may contain only the digits 0 and 1. Spaces, fractions and minus signs are rejected.
  • Decimal input must be a whole number of zero or more. Anything above 9,223,372,036,854,775,807 is treated as that value, which is 63 ones in binary.
  • Hex input may use the digits 0 to 9 and the letters A to F in either case, with an optional 0x in front. Results in hex are lowercase.
  • In calculator mode the two numbers are typed as strings of binary digits. If you type a decimal point, the part after it is ignored.
  • Dividing by zero is rejected.

Binary to decimal

Write the place values 1, 2, 4, 8 and so on under the bits, from the right, and add up the values that sit under a 1.

Example: 101101. The place values from the left are 32, 16, 8, 4, 2, 1, and the bits are 1, 0, 1, 1, 0, 1. Adding the places under the ones gives 32 + 8 + 4 + 1 = 45.

A second way avoids remembering powers of two. Scan the bits from the left, double your running total and add the next bit. For 101101 the running totals are 1, 2, 5, 11, 22, 45, which lands on the same answer.

Decimal to binary

Divide the number by 2 again and again, noting each remainder, until the quotient reaches 0. The remainders read from last to first are the bits.

Converting 156 to binary
DivisionQuotientRemainder
156 ÷ 2780
78 ÷ 2390
39 ÷ 2191
19 ÷ 291
9 ÷ 241
4 ÷ 220
2 ÷ 210
1 ÷ 201

Reading the remainders from the bottom up gives 10011100. As a check, 128 + 16 + 8 + 4 = 156.

Binary and hexadecimal

Because 16 = 24, conversion between binary and hex needs no arithmetic. Split the binary number into groups of four bits starting from the right, then replace each group with its hex digit.

Binary to hex. 10110111 splits into 1011 and 0111, which are B and 7, so the hex value is B7 (183 in decimal).

Hex to binary. Replace each hex digit with its four bits. 3F5 becomes 0011, 1111 and 0101. Dropping the leading zeros leaves 1111110101 (1,013 in decimal).

Arithmetic with binary numbers

The four operations follow the same column methods as decimal arithmetic. The only difference is that a column overflows at 2 instead of 10. The addition facts are short: 0 + 0 = 0, 0 + 1 = 1, 1 + 1 = 10 (write 0, carry 1) and 1 + 1 + 1 = 11 (write 1, carry 1).

Addition. 1011 + 110. From the right: 1 + 0 = 1; 1 + 1 = 10, so write 0 and carry 1; 0 + 1 + the carry gives 10, so write 0 and carry 1; 1 + the carry gives 10, so write 0 and carry 1; the last carry becomes the leading digit. The sum is 10001, which is 11 + 6 = 17.

Subtraction. 10010 − 101. Borrowing works as in decimal, but a borrowed 1 is worth 2 in the column to its right. The difference is 1101, which matches 18 − 5 = 13.

Multiplication. 101 × 11. Multiplying by a single bit gives either 0 or the number itself, and each higher bit shifts the number one place left. Here 101 × 1 = 101 and 101 × 10 = 1010, and 101 + 1010 = 1111, which is 5 × 3 = 15.

Division. 1111 ÷ 11 works like long division and gives 101, matching 15 ÷ 3 = 5. When a division does not come out even, the calculator shows only the whole part in the binary row. Its decimal row holds the full quotient: 1010 ÷ 110 (10 ÷ 6) shows a binary result of 1 and a decimal result of 1.666666666666666740682.

Limits and unusual results

  • Negative results. Subtracting a bigger number from a smaller one gives a negative result. The decimal row shows the sign (11 − 1010 is −7), while the binary row shows the 64-bit two's complement form, a string of 64 digits that starts with ones. That is how computers store negative integers.
  • Non-terminating quotients. Decimal quotients that do not end are printed as the exact stored value of the nearest double-precision number, not a tidy rounded figure. This is why 1010 ÷ 11 (10 ÷ 3) appears as 3.333333333333333481363.
  • Very long numbers. A binary string of 64 ones is 264 − 1, but the converter works in floating point beyond 63 bits and shows 264, which is 18,446,744,073,709,551,616. Exact conversion is guaranteed up to 63 bits.
  • Negative and fractional binary. The tool does not accept binary fractions or signed binary input such as −101.

For arithmetic on base-16 values, use the hexadecimal calculator. For quick one-way conversions there are also the binary to decimal converter and the decimal to binary converter.

Frequently asked questions

How do I convert binary to decimal?

Add up the place values (1, 2, 4, 8, ...) under each digit 1. For example, 101101 = 32 + 8 + 4 + 1 = 45.

How do I add two binary numbers?

Add column by column from the right. 1 + 1 gives 10, so write 0 and carry 1 to the next column. For example, 1011 + 110 = 10001, which is 11 + 6 = 17.

Why does a negative result show a long string of ones?

Binary values of negative integers are shown in 64-bit two's complement, the format computers use to store them. The decimal row displays the ordinary negative number.

Can the calculator handle binary fractions or negative binary numbers?

No. Binary input must be a string of 0s and 1s, with no point and no sign. Converting a negative number to binary is not supported either.

What is the largest number I can convert from decimal to binary?

9,223,372,036,854,775,807, which is 2^63 − 1 and 63 ones in binary. Larger entries are treated as that maximum.

References

  1. Knuth, D. E., The Art of Computer Programming, Volume 2: Seminumerical Algorithms, section 4.1 (Positional Number Systems)

Cite this calculator and page

If you use this page in your work, you can cite it as:

Reeliy Editorial Team. (2026). Binary Calculator & Converter. Reeliy. https://reeliy.com/calculators/binary-calculator“Binary Calculator & Converter.” Reeliy, 2026, https://reeliy.com/calculators/binary-calculator.