Calculator
Arithmetic with parentheses and percentages, plus a history of what you calculated.
Input
Type with the keyboard or use the keys below.
Preview
—
History
Press = or Enter to commit a calculation and it lands here. Reloading the page clears it.
How to use
- Type with the keyboard or press the on-screen keys.
- The result is previewed underneath while you are still typing.
- Press = or Enter to commit it, which adds the expression to the history.
- Tap a history row to load that expression back and keep working on it.
Frequently asked questions
How is the percent key handled?
% divides the value immediately before it by 100, so `200*10%` is 20 and `50%` is 0.5. It does not treat `100+10%` as 110 the way some desk calculators do — write `100*(1+10%)` for that.
What is the order of operations?
The usual one: parentheses first, then multiplication and division, then addition and subtraction. Operators of equal precedence are evaluated left to right.
What happens if I divide by zero?
You get a “cannot divide by zero” message and nothing is added to the history.
Does 0.1 + 0.2 give 0.3?
Yes. Underneath it is binary floating point, so the raw value is 0.30000000000000004, but the display trims to significant digits and shows 0.3.
Where is the history kept?
In the memory of this page only. Reloading or closing the tab clears it, and it is never sent to a server.
About the Calculator
A browser calculator is handy when opening a separate app is more effort than the sum is worth. It also helps with expressions mixing parentheses and percentages, which are easy to fumble key-by-key on a physical calculator — here you can read the whole expression before committing it.
Expressions are parsed by a hand-written tokenizer and recursive-descent parser. JavaScript's `eval` is not involved, so what you type is never executed as code.
The history is useful when you are working through several related figures: check an earlier result, or load an expression back and change one number.