Binary Calculator
Do arithmetic, bitwise logic, and base conversions on binary numbers. Results show in binary, decimal, and hexadecimal side by side.
Division is integer division: you get the whole quotient and the remainder. Bitwise NOT flips every bit within the width of the first number.
Every photo you take, every message you send, every video you stream is secretly a mountain of ones and zeros. Binary is the native language of computers, and even if you never write code, understanding it demystifies the machines you use all day.
A binary calculator lets you work directly in that language: add and subtract strings of bits, flip them with NOT, combine them with AND and OR, and convert between binary, decimal, and hexadecimal without reaching for a reference table.
This article explains how binary arithmetic works, what each bitwise operation actually does, and why hexadecimal exists as a convenient shorthand. Work through it once and bit strings will stop looking like noise.
What Does the Binary Calculator Do?
The calculator has three modes behind a toggle. Arithmetic mode adds, subtracts, multiplies, and integer-divides two binary numbers. Bitwise mode applies AND, OR, XOR, NOT, and bit shifts. Convert mode translates a value between binary, decimal, and hexadecimal.
Every result appears in a card showing all three bases at once: the binary string in large type, with decimal and hexadecimal beneath. You never have to convert the answer yourself.
Inputs accept up to 24 bits, which covers everything from nibble-sized examples to full color values and beyond. Invalid digits are rejected with a clear message rather than a wrong answer.
How to Use the Binary Calculator
First, pick your mode: Arithmetic, Bitwise, or Convert. The input panel switches to match.
In Arithmetic and Bitwise modes, type your two binary numbers using only the digits 0 and 1, then choose the operation from the dropdown. In Convert mode, type the value and select the from-base and to-base.
Press Calculate. The result card shows the answer in binary, decimal, and hexadecimal together, plus a note for special cases like division remainders.
Spaces and underscores in your input are ignored, so 1010 1100 pastes cleanly. Anything else that is not a 0 or 1 triggers an error.
Counting in Binary
Binary counts in powers of two instead of powers of ten. Each position, read right to left, is worth 1, 2, 4, 8, 16, and so on. The string 1010 means 8 plus 2, which is 10 in decimal.
To convert by hand, write the place values under the bits and add the values where you see a 1. For 1101: 8 + 4 + 0 + 1 gives 13.
Going the other way, subtract the largest power of two that fits, mark a 1, and repeat with the remainder. Thirteen minus 8 leaves 5, minus 4 leaves 1, minus 1 leaves 0, giving 1101.
Binary Addition
Binary addition follows four rules: 0+0=0, 0+1=1, 1+0=1, and 1+1=10, which is zero with a carry of 1. Work column by column from the right, exactly like decimal addition.
Add 1010 and 0111. Rightmost column: 0+1=1. Next: 1+1=10, write 0 carry 1. Next: 0+1 plus the carry = 10, write 0 carry 1. Leftmost: 1+0 plus the carry = 10. The result is 10001, which is 17 in decimal.
The calculator shows this as 1010 + 0111 = 10001, with 17 underneath. Try it and check each column by hand to build the habit.
Binary Subtraction and Multiplication
Subtraction borrows in twos instead of tens. Subtracting 0111 from 1010 gives 0011, or 3 in decimal: 10 minus 7. The calculator refuses results that would go negative, since plain binary has no sign.
Multiplication is shift-and-add. Multiplying by 1011 means adding the number shifted by 0, shifted by 1, and shifted by 3, skipping the zero positions. It is the same long multiplication you learned in school, just with simpler digits.
Division in the calculator is integer division: you get the whole quotient and the remainder. Dividing 1010 by 11 gives quotient 11 with remainder 1, that is 3 remainder 1 in decimal.
What Bitwise AND, OR, and XOR Do
Bitwise operations compare two numbers bit by bit. AND outputs 1 only where both bits are 1. OR outputs 1 where at least one bit is 1. XOR outputs 1 where the bits differ.
Take 1010 and 0111. AND gives 0010, keeping only the position where both had 1. OR gives 1111, since every position had at least one 1. XOR gives 1101, marking exactly the positions that differed.
Programmers use AND as a mask to test or clear specific bits, OR to set bits, and XOR to toggle them. The calculator aligns both numbers to the same width first, padding the shorter one with leading zeros.
NOT and Bit Shifts
NOT flips every bit: 1 becomes 0 and 0 becomes 1. The NOT of 1010 is 0101. It applies to the first number only, within its own width, so a 4-bit input gives a 4-bit answer.
Shift left moves every bit toward the more significant end, filling with zeros: 1010 shifted left by 2 becomes 101000. Each left shift multiplies by 2, which is why it is the fastest multiplication a computer can do.
Shift right moves bits the other way, dropping the lowest bits: 1010 shifted right by 1 becomes 101. Each right shift divides by 2, discarding any remainder.
Why Hexadecimal Exists
Long binary strings are hard to read, so hexadecimal groups bits in fours. Each group of four bits becomes one hex digit from 0 to 9 then A to F. The binary 11111111 becomes FF, and 10101111 becomes AF.
This is why you see hex everywhere in computing: color codes like #FF5733, memory addresses, and error codes. Each pair of hex digits is exactly one byte, eight bits.
The calculator always shows the hex equivalent of your result, so you can start recognizing the patterns. After a while, F0 and 0F feel as natural as 240 and 15.
Worked Example: Adding 1010 and 0111
First: select Arithmetic, enter 1010 and 0111, choose Add.
Then: the calculator converts both to decimal, 10 and 7, and adds them.
Then: 17 converts back to binary as 10001.
Answer: 10001 in binary, 17 in decimal, 11 in hexadecimal. Check by hand: the column addition carries twice, which is why the answer is five bits long.
Worked Example: XOR Mask
First: select Bitwise, enter 1010 and 0111, choose XOR.
Then: the calculator pads both to 4 bits and compares position by position.
Then: positions 1, 3, and 4 differ, giving 1101.
Answer: 1101 in binary, 13 in decimal, D in hexadecimal. XOR with 1 flips a bit, which is exactly how this mask toggled three of the four positions.
Worked Example: Converting FF
First: select Convert, type FF, choose from-base Hexadecimal and to-base Decimal.
Then: the calculator validates the hex digits and converts.
Then: F in the sixteens place is 240, plus 15, gives 255.
Answer: 255 in decimal, 11111111 in binary. Eight ones is the maximum value of a single byte, which is why 255 appears constantly in computing.
Common Binary Mistakes
The most common mistake is reading binary as decimal: seeing 1010 and thinking one thousand ten. In binary it is just ten, and the confusion causes wildly wrong expectations.
The second mistake is forgetting leading zeros in bitwise work. AND on 1010 and 111 gives 0010 only when both are treated as 4-bit numbers; misaligned widths produce garbage.
The third mistake is expecting subtraction to handle negatives. Plain binary has no minus sign, so 0111 minus 1010 has no answer here. Signed representations exist, but they are a separate topic.
The fourth mistake is shifting without watching the width. Left shifts grow the number quickly, and in real hardware the overflow bits fall off the end.
Where Binary Calculations Are Useful
Students meet binary in computer science courses, networking classes, and digital electronics, where every exercise is easier with a calculator to check the hand work.
Networking uses binary constantly: subnet masks like 255.255.255.0 are 24 one-bits, and AND operations decide which addresses belong to which network.
Designers and developers meet hex daily in color codes. Knowing that #FF0000 is full red, zero green, zero blue comes straight from reading byte pairs as hex.
How to Interpret Your Result Correctly
Read the binary string first and the decimal second. The binary is the real answer; the decimal is there so your brain can sanity-check the magnitude.
Check the bit width of bitwise results. The calculator pads to the wider input, so a result like 0010 is genuinely four bits, and those leading zeros matter.
For division, remember the answer is a quotient plus a remainder, not a decimal fraction. Binary long division with remainders matches how integer hardware actually divides.
Finally, use the hex column to build intuition. Spotting that 1010 is A and 1111 is F will pay off every time you meet a color code or a memory address.
Frequently Asked Questions
1. What is binary?
Binary is the base-2 number system using only the digits 0 and 1. Each position represents a power of two, and it is the native language of digital computers, which store everything as bits.
2. How do I convert binary to decimal?
Add the place values of every 1-bit, where places from the right are 1, 2, 4, 8, 16 and so on. For 1010, that is 8 + 2 = 10. The Convert mode above does it instantly.
3. How do I convert decimal to binary?
Repeatedly subtract the largest power of two that fits and record a 1 for each used power and 0 for skipped ones. For 13: 13 - 8 = 5, 5 - 4 = 1, 1 - 1 = 0, giving 1101.
4. What is 1010 + 0111 in binary?
10001, which is 17 in decimal. Adding column by column with carries: the two middle columns each produce a carry, so the result needs five bits.
5. What does bitwise AND do?
It compares two numbers bit by bit and outputs 1 only where both bits are 1. For 1010 AND 0111 the answer is 0010. It is used as a mask to test or isolate specific bits.
6. What does bitwise XOR do?
XOR outputs 1 where the two bits differ and 0 where they match. For 1010 XOR 0111 the answer is 1101. XOR with 1 toggles a bit, which is why it is used in simple encryption and checksums.
7. What is a bit shift?
Shifting moves every bit left or right by a number of places. Left shift multiplies by 2 per place, right shift divides by 2 per place, dropping remainders. 1010 shifted left by 2 is 101000.
8. What is hexadecimal?
Hexadecimal is base 16, using digits 0-9 and A-F. Each hex digit represents exactly four bits, so it is a compact way to write binary. FF is eight 1-bits, or 255.
9. Why do computers use binary?
Because electronic switches have two stable states, on and off, which map perfectly to 1 and 0. Two-state logic is simple, reliable, and cheap to build, so all digital data reduces to bits.
10. How many bits are in a byte?
Eight bits make one byte. A byte holds values from 00000000 (0) to 11111111 (255), which is why 255 appears so often in computing.
11. Can binary represent fractions?
Yes, with a binary point, just like a decimal point: 101.101 means 4 + 1 + 1/2 + 1/8. Computers more commonly use floating-point formats, but this calculator works with whole numbers.
12. What is the NOT of 1010?
0101. NOT flips every bit within the number’s width. In this calculator, a 4-bit input produces a 4-bit flipped result.
13. Why does division show a remainder?
This calculator performs integer division, matching how whole-number hardware divides. Dividing 1010 (10) by 11 (3) gives quotient 11 (3) with remainder 1.
14. What is a nibble?
A nibble is 4 bits, half a byte. It holds values 0 to 15 and maps to exactly one hexadecimal digit, which is why hex and binary convert so cleanly.
15. How do I read a hex color like #FF5733?
Split it into three byte pairs: FF red (255), 57 green (87), 33 blue (51). Each pair is one color channel at 0 to 255 brightness, and the Convert mode can decode any of them.