Basic Calculator
Everyday arithmetic with proper operator precedence, full keyboard support and a running history. Type with your keyboard or click the keys.
Keyboard: digits, + − * / %,Enter to equal, Backspace to delete a digit,Esc to clear all, Del to clear the current entry.
History
Calculations you complete will appear here. Click one to reuse its result.
How this calculator evaluates what you type
Operator precedence
Expressions are evaluated in two passes. Multiplication and division are folded first, left to right, then addition and subtraction over what remains:
2 + 3 × 4 → 2 + 12 (× folded first) → 14
A pocket calculator that evaluates strictly as you press keys would compute 2 + 3 = 5 and then 5 × 4 = 20. Neither is wrong as a design; they are answering different questions. This page follows written mathematical convention, because an expression typed into a web page reads like written maths rather than a sequence of button presses.
Why results are rounded for display
Binary floating point cannot represent 0.1 or 0.2 exactly, so their sum is 0.30000000000000004 rather than 0.3. The error is real but around 10⁻¹⁷, far below anything meaningful in everyday arithmetic. Results are therefore rounded to 12 significant figures, which is inside the roughly 15–17 digits a 64-bit double carries — enough to hide the artefact without ever hiding a genuine difference.
Errors rather than infinities
IEEE 754 defines 5 ÷ 0 as Infinity and 0 ÷ 0 asNaN. Both are mathematically well-defined in that standard and useless on a calculator, so division by zero reports an error and clears on the next keypress.
Frequently asked questions
Does this calculator follow order of operations?
Yes. It evaluates with standard precedence, so 2 + 3 × 4 gives 14, not 20. Many pocket calculators evaluate strictly left to right and would answer 20 — a real difference worth knowing about whichever device you use. Multiplication and division bind tighter than addition and subtraction; within the same level, evaluation runs left to right.
What is PEMDAS or BODMAS?
The order of operations: Parentheses or Brackets, Exponents or Orders, Multiplication and Division, then Addition and Subtraction. The common misreading is treating multiplication as outranking division — they share a level and are applied left to right, as are addition and subtraction. That detail resolves most viral arithmetic arguments.
Can I use my keyboard?
Yes. Number keys and the numeric keypad enter digits, + − * / enter operators (x also works for multiply), Enter or = evaluates, Backspace deletes the last digit, Escape clears everything, Delete clears just the current entry, and % applies percent.
How does the percent key work?
It follows the convention of physical calculators. In a pending operation, "200 + 10 %" reads the 10 as 10% of the running total, so it adds 20 and gives 220. Pressed on its own, percent simply divides by 100, so 50 % becomes 0.5. This is why the same key appears to behave differently in different contexts.
Why do some calculators show 0.30000000000000004 for 0.1 + 0.2?
Because computers store numbers in binary floating point, and 0.1 and 0.2 have no exact binary representation — just as 1/3 has no exact decimal one. The tiny discrepancy is inherent to the IEEE 754 standard used by virtually every programming language. This calculator rounds results to 12 significant digits for display, comfortably inside the precision a double actually carries, so you see 0.3.
What happens if I divide by zero?
It reports an error rather than showing Infinity. In IEEE 754 arithmetic, dividing a non-zero number by zero genuinely produces Infinity and 0 ÷ 0 produces NaN, but neither is a useful answer on a calculator, so both are caught. Pressing any digit afterwards starts a fresh calculation.
What does pressing equals repeatedly do?
It repeats the last operation. 2 + 3 = gives 5; pressing = again applies "+ 3" to that result for 8, then 11. After an expression with precedence such as 2 + 3 × 4 = 14, repeating applies the trailing "× 4". This mirrors how desk calculators behave and is handy for stepping through repeated growth.
Is anything I type sent anywhere?
No. The calculator runs entirely in your browser, and the history is held in memory only — it is discarded when you close or reload the tab. Nothing is uploaded, stored or logged.