Basic Calculator
Quick and simple arithmetic.
What is the Basic Calculator?
A quick arithmetic tool for addition, subtraction, multiplication and division, usable from the on-screen keypad or your physical keyboard. It parses expressions directly in the browser (no server, no external library) and supports chained calculations, letting you continue from a previous result.
How to use it
Tap numbers and operators, then press = to compute. C clears everything, ← deletes the last character, and % converts the current number to its percentage value (÷100). Keyboard shortcuts: digits and + - * /, . for the decimal point, Enter to compute, Backspace/Esc to delete, and % for percent.
Operator precedence
There are no parentheses buttons; instead, standard math rules apply — multiplication and division first, then addition and subtraction left to right. For example, 2 + 3 × 4 evaluates 3×4=12 first, then adds 2, giving 14 (not 20).
| Input | Order | Result |
|---|---|---|
| 2 + 3 × 4 | 3×4=12 → 2+12 | 14 |
| 10 − 4 ÷ 2 | 4÷2=2 → 10−2 | 8 |
| 50 % | 50 ÷ 100 | 0.5 |
| 7 ÷ 0 | Division by zero | Error |
The "6÷2(1+2)" debate and how the percent button differs
Expressions like 6 ÷ 2(1+2) famously produce two different answers, 1 or 9, depending on whether the implicit multiplication before the parenthesis is treated as higher priority than division (giving 6÷6=1) or as equal priority evaluated left to right (giving 3×3=9). This ambiguity comes from notation, not from either answer being wrong.
This calculator doesn't accept parentheses or implicit multiplication, so the ambiguity never arises: multiplication and division share the same precedence and are evaluated strictly left to right using a standard Shunting-yard approach.
The percent button also behaves differently across calculators. Some interpret 100 + 10 % as "add 10% of 100," giving 110. This calculator's % simply divides the currently entered number by 100, so 100 + 10 % converts 10 to 0.1 and adds it to 100, giving 100.1 — not 110.