Calculatorby CodingMarble
All calculators

Binary Calculator

Enter two binary numbers and pick an operation to get the answer in binary, decimal, hex and octal, or switch to convert a number between bases with step-by-step working.

Only 0 and 1. Whole numbers up to 2⁵³ − 1.

Your result appears here.

What is a binary calculator?

A binary calculator does arithmetic on numbers written in base 2 – the language of computers, which uses only the digits 0 and 1. This online binary calculator adds, subtracts, multiplies and divides binary numbers and gives the answer in binary, decimal, hexadecimal and octal. Switch to convert mode and it becomes a binary converter: enter a number in any of the four bases and see it in all of them, with the division-by-2 steps shown.

It handles whole numbers up to 253 − 1 (9,007,199,254,740,991, a 53-bit number) exactly, which covers everything from school homework to IP addresses and memory addresses.

How to use the binary calculator

  1. Choose Binary arithmetic or Convert.
  2. For arithmetic, type two binary numbers (spaces are ignored, so 1010 0110 works) and pick +, −, × or ÷.
  3. For conversion, type the number and choose the base it is written in.
  4. Read the result in every base, plus the step-by-step working: column addition with carries, or the divide-by-2 table.

What is the binary number system?

In our everyday decimal system each place is worth ten times the one to its right (ones, tens, hundreds). In the binary number system each place is worth two times the one to its right: 1, 2, 4, 8, 16, 32, 64, 128 and so on. Each digit is a bit; 8 bits make a byte. Computers use binary because a transistor has two stable states – off (0) and on (1).

DecimalBinaryHexOctal
0000000
1000111
2001022
5010155
81000810
101010A12
151111F17
161 00001020
2551111 1111FF377

How to calculate binary to decimal

Multiply each bit by its place value (a power of 2) and add them up:

Decimal = bn×2n + … + b2×22 + b1×21 + b0×20

Example: 10011100 = 128 + 16 + 8 + 4 = 156. Only the places holding a 1 count.

How to convert decimal to binary

To find the binary equivalent of a decimal number, divide by 2 repeatedly and write down each remainder. Then read the remainders from the last one to the first.

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

Reading upward gives 156 = 10011100. The calculator's convert mode shows this table for any number.

Binary to hexadecimal and octal

Hex and octal are shorthand for binary. Group the bits in fours from the right for hex (1001 1100 = 9C) and in threes for octal (10 011 100 = 234). That is why programmers write colours, memory addresses and byte values in hexadecimal.

Binary arithmetic rules with examples

Binary addition

The four rules: 0 + 0 = 0; 0 + 1 = 1; 1 + 1 = 10 (write 0, carry 1); 1 + 1 + 1 = 11 (write 1, carry 1). Example: 1011 + 110 = 10001 (11 + 6 = 17). The calculator shows the carry row, so it works as a binary calculator with carry and with steps.

Binary subtraction

0 − 0 = 0; 1 − 0 = 1; 1 − 1 = 0; 0 − 1 = 1 with a borrow of 1 from the next column. Example: 1011 − 110 = 101 (11 − 6 = 5). If the second number is larger, the answer is negative; the calculator shows it with a minus sign and as a 32-bit two's complement – the way computers store negative numbers (invert the bits, then add 1).

Binary multiplication

Multiply like long multiplication in decimal, but each partial product is either 0 or a shifted copy of the first number: 1011 × 110 = 10110 + 101100 = 1000010 (11 × 6 = 66).

Binary division

Use long division: 1011 ÷ 110 = 1 remainder 101 (11 ÷ 6 = 1 r 5). The calculator gives the whole-number quotient and the remainder, as in integer division.

Binary calculator for IP addresses and bitwise work

Each part of an IPv4 address is one byte (8 bits). Convert each part separately: 192.168.1.10 becomes 11000000.10101000.00000001.00001010. A subnet mask of 255.255.255.0 is 24 ones followed by 8 zeros, written /24. Bitwise operations such as AND, OR and XOR compare bits one column at a time – AND gives 1 only when both bits are 1, OR when either is 1, XOR when they differ – which is how logic gates in a CPU build a binary calculator circuit.

Signed, unsigned and floating point binary

An unsigned 8-bit number stores 0–255. A signed 8-bit number in two's complement stores −128 to 127. Numbers with a decimal point are stored in floating point (IEEE 754), which splits the bits into sign, exponent and fraction; that is why 0.1 cannot be stored exactly in binary. This calculator works with whole numbers only, which keeps every answer exact. For powers of two, use the exponent calculator; for base-2 logarithms (how many bits a number needs), use the log calculator.

How to calculate binary in a scientific calculator

Many scientific calculators have a BASE-N mode (often MODE → BASE-N on Casio) with BIN, DEC, HEX and OCT keys. Enter the number in one base, press the key for another base, and it converts. The scientific calculator on this site handles decimal maths; use this page for binary.

Binary calculator with solution: worked examples

Each example below is what the binary calculator with steps shows, so you can check a binary calculation by hand. These also make good binary calculation questions for practice.

Binary calculator addition

1011 + 0110: add column by column from the right. 1 + 0 = 1; 1 + 1 = 10, write 0 carry 1; 0 + 1 + 1 = 10, write 0 carry 1; 1 + 0 + 1 = 10, write 0 carry 1. Answer: 10001 (11 + 6 = 17).

Binary calculator subtraction

1101 − 0110: 1 − 0 = 1; 0 − 1 needs a borrow, giving 10 − 1 = 1; then 0 − 1 borrows again, giving 1; finally 0 − 0 = 0. Answer: 0111 (13 − 6 = 7).

Binary calculator multiplication and division

110 × 11 = 110 + 1100 = 10010 (6 × 3 = 18). For binary calculator division, 1100 ÷ 11 = 100 (12 ÷ 3 = 4), found by long division exactly as in decimal: 11 goes into 11 once, then bring down the two 0s.

Binary calculator for 3 numbers

To add 3 numbers, add two first and then add the third: 101 + 110 = 1011, and 1011 + 011 = 1110 (5 + 6 + 3 = 14). Use the answer box as the first input for the next step.

Binary calculator with a decimal point

Digits after the binary point are worth ½, ¼, ⅛ and so on. 10.1 + 1.01 = 11.11, which is 2.5 + 1.25 = 3.75. Line up the binary points before you add. This calculator works with whole numbers, so multiply both numbers by the same power of 2 first (shift the point), calculate, then shift back.

Binary calculator formula

The binary calculator formula for converting any binary number is: value = sum of (bit × 2position), counting positions from 0 on the right. For 1011 that is 1×8 + 0×4 + 1×2 + 1×1 = 11. The four arithmetic rules are 0 + 0 = 0, 0 + 1 = 1, 1 + 1 = 10 (carry 1) and 1 + 1 + 1 = 11. A binary form calculator or binary equation calculator uses the same rules for every step.

How to calculate binary numbers

To calculate binary numbers by hand, write each number in columns of 8, 4, 2 and 1, apply the rules above from right to left and carry or borrow 2 instead of 10. For a visual check, the binary calculator converter shows the same answer in decimal, hex and octal.

Place value8421Decimal
1011101111
011001106
1000116 + 117

This table is a simple binary calculator visual: every column is a power of two, and a 1 means that value is counted.

Binary calculator with overflow and inverse

A binary calculator with overflow limits answers to a fixed number of bits. In 4 bits, 1111 + 0001 = 10000, but only 0000 fits, so the carry is lost – that is overflow. This calculator does not cut answers to a fixed width, so you always see the full result. A binary inverse calculator flips every bit (one's complement): the inverse of 0101 is 1010. Add 1 to that and you get the two's complement, 1011, which stands for −5 in 4 bits.

Binary calculator floating point

Computers store fractions using IEEE 754 floating point: a sign bit, an exponent and a fraction. Some decimals cannot be stored exactly – 0.1 is a repeating binary fraction (0.000110011…), which is why 0.1 + 0.2 gives 0.30000000000000004 in many programs.

Binary converter for IP address

Each part of an IPv4 address is an 8-bit number. As a binary converter for an IP address, convert each part on its own: 192.168.1.10 = 11000000.10101000.00000001.00001010. Pad every part to 8 digits so subnet masks line up.

Binary calculator to words

Text becomes binary through a character code such as ASCII. As a binary calculator for words, convert each letter's code: H is 72 = 01001000 and i is 105 = 01101001, so "Hi" is 01001000 01101001. To turn binary back to words, convert each 8-bit group to decimal and look up the letter. This page converts numbers; use an ASCII table for the letters.

Binary calculator using logic gates

Inside a chip, a binary calculator using logic gates adds with a half adder: an XOR gate gives the sum bit and an AND gate gives the carry. Two half adders and an OR gate make a full adder, and a row of full adders adds whole numbers. Building one is a popular school binary calculator project on a breadboard.

Binary calculator in Minecraft

A binary calculator in Minecraft is built the same way: redstone torches and dust act as NOT, OR and AND gates, which combine into XOR gates and full adders. Levers are the input bits and lamps show the answer in binary.

Binary calculator game ideas

Turn practice into a binary calculator game: one player says a decimal number from 0 to 31 and the other writes it with five cards worth 16, 8, 4, 2 and 1, face up for 1 and face down for 0. Check answers with the converter.

Binary calculator in Python, Java, JS and Linux

  • Binary calculator in Python: bin(0b1011 + 0b110) gives '0b10001', and int('1011', 2) gives 11.
  • Binary calculator in Java: Integer.parseInt("1011", 2) reads binary and Integer.toBinaryString(17) writes it.
  • Binary calculator in JS: parseInt('1011', 2) gives 11 and (17).toString(2) gives '10001'.
  • Binary calculator on Linux: echo "obase=2; 17" | bc prints 10001, and echo $((2#1011 + 2#110)) prints 17 in bash.

Binary calculator app and iPhone

You do not need a binary calculator app: this page works in any phone browser. On an iPhone with iOS 18 or later, the built-in Calculator also has a Programmer mode that shows binary.

Frequently asked questions

How do you add binary numbers?

Add column by column from the right using 0+0=0, 0+1=1, 1+1=10 (write 0, carry 1) and 1+1+1=11. For example, 1011 + 110 = 10001.

How do I convert binary to decimal?

Multiply each bit by its power of 2 and add the results. 10011100 = 128 + 16 + 8 + 4 = 156.

How do I convert decimal to binary?

Divide the number by 2 repeatedly and note each remainder; read the remainders from bottom to top. 156 becomes 10011100.

What is 1 + 1 in binary?

1 + 1 = 10 in binary, which is 2 in decimal.

How does the binary calculator handle negative numbers?

When a subtraction gives a negative result, it shows a minus sign and the 32-bit two's complement form used by computers.

What is the largest number this binary calculator supports?

Whole numbers up to 2^53 − 1 (9,007,199,254,740,991), a 53-bit binary number, are calculated exactly.

What is binary used for?

Computers store all data – numbers, text, images and instructions – as binary bits because digital circuits have two states, on and off.

How do you do binary subtraction?

Subtract column by column from the right. When you take 1 from 0, borrow 1 from the next column, which makes the current digit 10 (two), so 10 − 1 = 1. Example: 1101 − 0110 = 0111.

Can this binary calculator handle a decimal point?

It works with whole numbers. For fractions, shift the binary point by multiplying both numbers by the same power of 2, calculate, then shift back.

What is overflow in binary?

Overflow happens when an answer needs more bits than are available, for example 1111 + 1 = 10000 in a 4-bit register, where the leading 1 is lost.

Last updated 2026-09-18

Related calculators

Designed & built with care by This calculator site, LovePDF and LoveImage are made in India by the CodingMarble team — websites, web apps and SEO-first tools.Visit CodingMarble