Binary Calculator
Show the math
What Your Result Means
- Base Converter: All four fields stay in sync — type into any base and the others update instantly. Binary (base 2) uses only 0 and 1, octal (base 8) uses 0–7, decimal (base 10) uses 0–9, and hexadecimal (base 16) uses 0–9 and A–F.
- Result (Binary): The sum or difference of your two binary inputs, shown in base 2.
- Result (Decimal): The same answer expressed in base 10 for easier readability.
How This Calculator Works
You enter a number in any base and the tool converts it to a decimal integer using the positional value of each digit, then re-expresses that integer in the remaining bases. The arithmetic section parses two binary strings into decimal, performs addition or subtraction, and converts the result back to binary.
Quick Questions
Why do computers use binary?
Digital circuits operate with two voltage states (on/off), which map naturally to binary digits 0 and 1. Every piece of data a computer processes is ultimately stored and manipulated in binary.
What is hexadecimal used for?
Hexadecimal is a compact way to represent binary data — each hex digit maps to exactly 4 binary bits. It is commonly used for memory addresses, color codes, and byte-level debugging.
Can this handle negative numbers?
The arithmetic section shows negative results with a minus sign when subtracting a larger number from a smaller one. The base converter handles non-negative integers only.
What is the largest number this supports?
This tool uses JavaScript's standard number type, which can represent integers exactly up to 2^53 − 1 (about 9 quadrillion). For larger values, try the Big Number calculator.
Sources
- Wikipedia — Binary Number (positional numeral system overview)
- Wikipedia — Hexadecimal (base-16 numbering and uses)
- MDN Web Docs — parseInt() (JavaScript base conversion reference)
Method & review
Estimate only. Results reflect your inputs and standard formulas. Double-check important decisions independently.