Binary Calculator

Add, subtract, multiply, and divide binary numbers, or run AND, OR, and XOR bitwise operations, with instant decimal, hexadecimal, and octal equivalents.

Results

Calculated
Result
—

How to use this calculator

Enter your values in the fields above and click Calculate to see your results instantly. All calculations run in your browser — no data is sent to a server and results appear immediately. Click Clear to reset all fields and start over.

Understanding your inputs

Each input field is labeled with the specific value it expects. Hover over the ? hint icons (where present) for additional guidance on what each field means and what units to use. For best results, double-check that all your input values use consistent units before calculating.

Interpreting the results

Results are shown immediately after clicking Calculate. The highlighted result card shows the primary output — the value most people need. Additional cards show supporting calculations that provide context and help you verify the primary result makes sense. If results seem unexpected, re-check your inputs for typos or unit mismatches.

About this binary calculator

This calculator performs binary arithmetic (addition, subtraction, multiplication, and division with remainder) and bitwise logic (AND, OR, XOR) directly on the binary numbers you enter. Internally it converts each binary value to its decimal equivalent, applies the operation, then converts the result back to binary, decimal, hexadecimal, and octal — matching the same answer you'd get doing the arithmetic by hand, column by column, in base 2.

Decimal to Binary Quick Reference (0–15)

DecimalBinaryHex
000000
100011
200102
300113
401004
501015
601106
701117
810008
910019
101010A
111011B
121100C
131101D
141110E
151111F

Powers of 2 Reference

n2nCommon name
01
12
24
38
416
532
664
7128
8256
9512
101,0241 KB
1665,53664 KB
201,048,5761 MB
301,073,741,8241 GB
324,294,967,2964 GB
40≈1.1 trillion≈1 TB
64≈1.8 × 1019≈18 EB

Number Bases Summary

BaseNameDigits usedPrefix
2Binary0, 10b
8Octal0–70o
10Decimal0–9(none)
16Hexadecimal0–9, A–F0x

Frequently Asked Questions

How do I add or subtract binary numbers?
Binary addition follows the same place-value carry rules as decimal addition, except every digit can only be 0 or 1: 1 + 1 = 10 (write 0, carry 1), and 1 + 1 + 1 = 11 (write 1, carry 1). Subtraction borrows the same way, borrowing 2 (not 10) from the next column to the left. This calculator does the conversion-and-back-conversion for you automatically.
What do AND, OR, and XOR do?
These are bitwise logic operations that compare each binary digit (bit) of the two numbers individually. AND returns 1 only when both bits are 1. OR returns 1 when at least one bit is 1. XOR (exclusive or) returns 1 when exactly one of the two bits is 1, and 0 when they match. These operations are the building blocks of digital logic circuits and computer processors.
How is a negative subtraction result shown?
If the second binary number is larger than the first, subtraction produces a negative result. This calculator shows negative results in sign-magnitude form — a minus sign followed by the binary magnitude — so the value is easy to read directly, rather than in two's complement form.
How do I convert the result to hexadecimal or octal?
Every result on this page is shown alongside its decimal, hexadecimal, and octal equivalents automatically. Hexadecimal groups binary digits into sets of 4 (each hex digit represents 4 bits); octal groups them into sets of 3 (each octal digit represents 3 bits).
How do you convert binary to decimal?
Start from the rightmost bit (position 0) and work left. Multiply each bit by 2 raised to its position, then add all the products. For example, 1011 = (1×2³) + (0×2²) + (1×2¹) + (1×2⁰) = 8 + 0 + 2 + 1 = 11. The quick reference table above lists every 4-bit combination from 0 to 15 for easy lookup.
What is hexadecimal used for?
Hexadecimal (base 16) is widely used in computing because each hex digit maps exactly to 4 binary bits, making binary data far more compact to read and write. You'll see hex in memory addresses, HTML/CSS color codes (e.g., #FF5733), file checksums, machine-code listings, and network MAC addresses. Converting between binary and hex is mechanical: split the binary into groups of 4 from the right and replace each group with its hex digit.
How do you convert decimal to binary?
Use repeated division by 2: divide the decimal number by 2, record the remainder (0 or 1), then divide the quotient again — keep going until the quotient reaches 0. Reading the remainders from bottom to top gives the binary result. For example: 13 ÷ 2 = 6 r 1 → 6 ÷ 2 = 3 r 0 → 3 ÷ 2 = 1 r 1 → 1 ÷ 2 = 0 r 1, so 13 in binary is 1101.
What does a byte look like in binary?
A byte is 8 bits, so it always has exactly 8 binary digits. The smallest byte is 00000000 (decimal 0) and the largest is 11111111 (decimal 255). As practical examples: the letter A (ASCII 65) is 01000001, the number 200 is 11001000, and the common subnet mask value 255 is 11111111. This is why IPv4 addresses are sometimes described as four groups of 8-bit values.

Practical Guide for Binary Calculator

Binary Calculator is most useful when the inputs reflect the situation you are actually planning around, not a best-case estimate. Treat the result as a decision aid: it gives you a structured way to compare assumptions, spot outliers, and decide what to verify next. For Conversion work, the most important review lens is source unit, target unit, rounding, scale, and whether the conversion is exact or context dependent.

Start with a baseline run using values you can defend. Then change one assumption at a time and watch which output moves the most. If one input dominates the result, spend your verification time there first. If several inputs have similar influence, use a conservative scenario and an optimistic scenario to create a practical range instead of relying on a single exact number.

Before acting on the result, verify the converted value against the original unit system and any industry-specific convention. This is especially important when the calculator supports a purchase, project plan, performance target, or operational decision. The calculator can make the math consistent, but the quality of the conclusion still depends on current data, clear units, and assumptions that match your real constraints.

Review Checklist

  • Confirm every input uses the unit and time period requested by the calculator.
  • Run a low, expected, and high scenario so the answer has a useful range.
  • Check whether rounding or a missing decimal place changes the decision.
  • Update the calculation whenever units, precision, or reporting format changes.