Basic Calculator
Add, subtract, multiply, or divide two numbers with this simple four-operation calculator.
How It's Calculated
Formula
a \; \text{op} \; b \quad \text{op} \in \{+, -, \times, \div\}This is a basic four-operation calculator: it adds, subtracts, multiplies, or divides two numbers, nothing more. It does not evaluate multi-step expressions or respect operator precedence (like a scientific calculator's '2 + 3 × 4') — enter exactly two numbers and pick one operation to apply between them. Addition combines two values into their sum, subtraction finds the difference between them, multiplication finds their product, and division splits the first number into that many equal parts of the second. Division by zero is undefined and is rejected as an invalid input rather than silently returning Infinity or an error value.
Worked Examples
Add 12 and 8
- 12 + 8
- Result: 20
Divide 20 by 4
- 20 ÷ 4
- Result: 5
Frequently Asked Questions
Can I enter a full expression like 2 + 3 × 4?
No. This calculator only supports one operation between exactly two numbers at a time. It is not an expression parser and does not apply operator precedence. For multi-step math, calculate one operation at a time.
What happens if I divide by zero?
Division by zero is mathematically undefined, so this calculator rejects it as an invalid input with a clear error message rather than returning Infinity or a misleading number.
Does this handle negative numbers and decimals?
Yes. Both numbers can be positive, negative, zero, or decimal values, and all four operations work the same way regardless of sign.