Calculator
A working calculator with brackets, percentages and full keyboard support.
Runs in your browser using A hand-written expression parser — nothing is uploaded
How to use it
- Type with the keypad or your keyboard — digits, + − × ÷, brackets and % all work.
- Press Enter or = to calculate; Backspace deletes and Escape clears.
- The running result previews as you type, and recent calculations are listed underneath.
Questions
How does the percent key work?
The way a desk calculator does. "200 + 10%" adds ten percent of 200 and gives 220, while "200 × 10%" multiplies by 0.1 and gives 20. On its own, "10%" is 0.1.
Why does 0.1 + 0.2 show 0.3 here?
Computers store decimals in binary, where 0.1 + 0.2 lands a fraction above 0.3. The result is rounded to twelve significant figures before display, which removes that artefact without affecting real precision.
Is it safe to type anything into it?
Yes. The expression is read by a parser written for this page, not passed to eval(). Anything that is not arithmetic is refused with a message rather than run.