Binary Calculator

Convert binary and decimal values or add two binary numbers.

Binary Calculator

Formula

bin2dec parseInt base2; dec2bin toString(2); bin_add sum then toString(2)

Uses base 2 parse and stringify. Addition happens in integer space.

This binary calculator converts binary to decimal, decimal to binary, or adds two binary values. Default binary 1010 equals decimal 10.

binary calculator

Modes cover Binary to Decimal, Decimal to Binary, and Add two binaries. Subtraction, bitwise operators, and automatic step diagrams are not included.

Methods

Binary to decimal reads the string as base 2. Decimal to binary writes a non negative integer in base 2. Addition converts both binaries to integers, adds them, then writes the sum in binary.

Worked examples

Binary to decimal: 1010 = 8 + 2 = 10. Decimal to binary: 13 = 1101. Add: 1011 + 1101 = 11 + 13 = 24 = 11000 in binary.

Common mistakes

  • Digits other than 0 or 1 in binary mode.
  • Negative decimals (not supported).
  • Empty second field when adding.

For hexadecimal work, open the hex calculator. For roots and powers, try the exponent calculator or the root calculator.

Binary place values

In base 2, each position is worth twice the one to its right. As Wolfram MathWorld’s entry on binary explains, a number is written using only the digits 0 and 1, each multiplied by a power of 2.

Position (from right)8th7th6th5th4th3rd2nd1st
Value1286432168421

Binary to decimal: add the place values of the 1s

To check the binary calculator by hand, write the place values under each digit and add those marked 1. For 101101: 32 + 8 + 4 + 1 = 45. Leading zeros add nothing, so 00101101 is still 45.

Decimal to binary: divide by 2 and read the remainders upward

Divide by 2 repeatedly, note each remainder, then read the remainders from last to first.

  • 45 ÷ 2 = 22 remainder 1
  • 22 ÷ 2 = 11 remainder 0
  • 11 ÷ 2 = 5 remainder 1
  • 5 ÷ 2 = 2 remainder 1
  • 2 ÷ 2 = 1 remainder 0
  • 1 ÷ 2 = 0 remainder 1

Reading upward gives 101101, which matches the first example.

Binary calculator worked example: 101101 + 1011

The binary calculator follows four addition rules: 0 + 0 = 0, 0 + 1 = 1, 1 + 1 = 10 (write 0, carry 1), and 1 + 1 + 1 = 11 (write 1, carry 1). Working from the right:

  1. 1 + 1 = 10: write 0, carry 1.
  2. 0 + 1 + carry 1 = 10: write 0, carry 1.
  3. 1 + 0 + carry 1 = 10: write 0, carry 1.
  4. 1 + 1 + carry 1 = 11: write 1, carry 1.
  5. 0 + carry 1 = 1: write 1.
  6. 1: write 1.

Result: 111000. Check it in decimal: 101101 = 45 and 1011 = 11, so 45 + 11 = 56, and 111000 = 32 + 16 + 8 = 56. ✔

Bits, bytes and the range of a binary calculator result

With n bits you can write 2n unsigned values, from 0 to 2n − 1. One byte (8 bits) covers 0 to 255. Sixteen bits cover 0 to 65,535. In the example, 56 still fits in 6 bits, but adding one more 1 at the top would need a seventh bit. That overflow is why fixed-width registers can “wrap around”.

What this tool does not do

The binary calculator works with unsigned whole numbers. It does not handle negative numbers (two’s complement), fractions or bitwise AND/OR/XOR. To convert to base 16, group binary digits in fours from the right: 101101 becomes 0010 1101, which is 2D in hex. The hex calculator can confirm that.

Where binary shows up outside the classroom

Computers store every number, character and pixel as bits, so binary appears in subnet masks (255 = 11111111), file permissions, color codes and flags in settings files. Reading a mask like 11111111.11111111.11111111.00000000 as 255.255.255.0 is the same place-value method shown above, applied to four separate bytes. To get the network and broadcast address for a prefix such as /24, use the IP subnet calculator. Likewise, a Unix permission of 7 is 111 (read, write, execute all on) and 5 is 101 (read and execute, no write).

Last reviewed: October 2026

Related calculators

Frequently Asked Questions

What does the default example show?

Binary 1010 in Binary → Decimal mode equals decimal 10.

Which characters are allowed in binary?

Only 0 and 1 digits for binary modes.

What does the second value field do?

It is used when you choose Add two binaries. Default second binary is 110.

How do I convert decimal to binary?

Choose Decimal → Binary and enter a non-negative whole number in the value field.

What is 1010 + 110 in binary?

Decimal 10 + 6 = 16, which is binary 10000.

Are negative decimals supported?

The decimal to binary path expects non-negative integers.

Is leading zero allowed?

Yes for binary strings, though it does not change the numeric value.

Does this show two’s complement?

No. It focuses on unsigned conversion and simple binary addition.

What is 101101 in decimal?

45. The 1s sit in the 32, 8, 4 and 1 places, and 32 + 8 + 4 + 1 = 45.

How do you convert decimal to binary?

Divide by 2 repeatedly, write down each remainder, then read the remainders from the last one to the first. For example, 45 becomes 101101.

What is 1 + 1 in binary?

10. You write 0 and carry 1 into the next place, just as 9 + 1 carries in decimal.

Does the binary calculator handle negative numbers?

No. It converts and adds unsigned whole numbers. Negative values need a two's-complement representation, which this tool does not show.