What is Binary Calculator?
A binary arithmetic calculator that adds, subtracts, multiplies, divides, takes the modulo, and raises one binary number to a power. Shows results in binary, decimal, octal, and hexadecimal simultaneously.
Beyond the basic operations, the calculator shows every result in four bases at once so you can see how the same value looks in binary, decimal, octal, and hex. Type a number in decimal and it auto-converts to binary before the math runs. It accepts arbitrarily long inputs and handles negative results from subtraction. Division is integer-only and drops the remainder, matching low-level CPU instructions — use the modulo operation when you want that remainder instead, or the power operation to compute exponents. Pick an 8-, 16-, or 32-bit register width to pad the result to that size and read it as a two's-complement signed value, exactly the way a CPU register would store it.
How to use
- Enter two numbers — keep them in binary, or flip a field to decimal and it converts to binary for you.
- Pick an operation: add, subtract, multiply, divide, modulo (remainder), or raise to a power, plus bitwise AND, OR, XOR, NOT and shifts.
- See the result in binary, decimal, octal, and hexadecimal.
When to use
- Checking bitwise math homework or studying for a digital-logic exam.
- Converting a known binary register value into decimal and hex side by side.
- Sanity-checking carry and borrow behaviour before writing an assembler routine.
Result
11011 + 10110 (27 + 22 in decimal) gives 110001 (49), shown in binary, decimal, octal, and hex.
FAQ
- Why does subtracting a bigger number from a smaller one give a negative decimal?
- The calculator treats inputs as unsigned positive integers and shows the signed result. Real CPUs use two's complement and would wrap around to a large positive value instead — so 0001 minus 0010 reads as -1 here, but in an 8-bit register it would be 11111111. Pick an 8-bit register width above to see that exact pattern and how it reads as a signed value.
- Does the calculator support two's complement input?
- Inputs are still read as plain magnitude with no sign bit. But you no longer have to pad by hand: pick an 8-, 16-, or 32-bit register width and the result is shown as a two's-complement value, padded to that width and wrapped exactly like a hardware register, alongside its signed decimal reading.
- Why does division round down instead of giving a decimal answer?
- Binary division here mirrors the integer DIV instruction on most processors: it truncates toward zero and discards the remainder. 1010 ÷ 0011 (10 ÷ 3) returns 11 (3 in decimal), not 3.33. If you actually want the leftover, switch to the modulo operation; for a fractional answer, convert to decimal first.
- What's the maximum length of binary string I can use?
- JavaScript's parseInt and Number happily handle up to 53 bits of precision, so inputs of about 50 bits give exact results. Past that, the lowest bits may drift due to floating-point rounding — fine for learning, not for cryptographic work.
- How do I read the hex result?
- Hex (base 16) groups every 4 binary bits into one digit using 0–9 then A–F. So 11111111 binary equals FF hex equals 255 decimal. Programmers prefer hex because each digit maps cleanly to one nibble of a byte.
Related Tools
Regression Calculator
Perform linear and polynomial regression analysis
Matrix Calculator
Perform matrix operations and calculations
Chi-Square Calculator
Perform chi-square statistical tests
Graphing Calculator
Plot mathematical functions on a graph
Area Calculator Map
Draw shapes on a map to calculate area
Z-Score Calculator
Calculate z-scores, percentiles, and probabilities