Binary Calculator
Input Base
Operation
Result10110
Decimal22
Binary10110
Hex16
Octal26
This binary calculator adds, subtracts, multiplies, and divides numbers entered in binary, decimal, hexadecimal, or octal, then shows the answer in all four bases at once. Choose the base your inputs are written in, and the tool interprets every digit accordingly before computing. Division returns the integer quotient, which is the natural result for whole-number base arithmetic.
Formula
result = decode(a, base) ∘ decode(b, base), then re-encode to each base
- a, b
- The two operands written in the selected input base
- base
- The numeral base of the inputs: 2, 8, 10, or 16
- ∘
- The chosen operation: +, −, ×, or ÷ (integer division)
How it works
- Pick the input base — binary (base 2), decimal (base 10), hexadecimal (base 16), or octal (base 8) — so the calculator knows how to read your digits.
- Enter two values and choose an operation: add, subtract, multiply, or divide. The values are converted to decimal internally to perform the arithmetic.
- The result is shown in the input base along with its binary, decimal, hexadecimal, and octal equivalents. Division yields the floored integer quotient.
Worked example
Add the binary numbers 1010 and 1100.
- Decode from binary: 1010₂ = 10 and 1100₂ = 12 in decimal.
- Add: 10 + 12 = 22.
- Re-encode 22 to binary: 10110₂.
1010 + 1100 = 10110 in binary (22 decimal, 16 hex, 26 octal).
Frequently asked questions
- What does binary division return?
- It returns the integer quotient with any fractional part discarded (floored). For example, dividing 1011 (11) by 10 (2) gives 101 (5), not 5.5.
- How is binary converted to decimal?
- Each binary digit is weighted by a power of two based on its position, and the weighted digits are summed. So 1010 is 1×8 + 0×4 + 1×2 + 0×1 = 10 in decimal.
- Can I mix bases between the two inputs?
- No. Both operands are read in the single input base you select. To work with a value written in a different base, convert it first or change the input base.
- Why is the answer shown in four bases?
- Seeing binary, decimal, hexadecimal, and octal side by side makes it easy to cross-check a result and to use it in whichever base your project needs without a second conversion step.