One line per step. Name a value and every line below can use it — change the top and the whole sheet re-runs. Nothing scrolls away, so you can check the working instead of trusting a number you can no longer see.
Tap any of these to drop it into the line you are on. Names are case-insensitive, and a value you define beats a built-in constant of the same name.
None of them is arithmetic. All three are the calculator answering a question you did not ask.
2 + 3 × 4 is 14, not 20. Multiplication binds tighter than addition, so the 3 belongs to the 4, not to the 2. A four-function calculator with no brackets chains left to right and gives you 20 — and so does anybody typing fast. This page prints how it grouped your expression underneath the answer, so the two of you can disagree before the number matters.
sin(90) is 1 in degrees and 0.894 in radians. Same keys, same display, an 11% error. It is the single most common wrong answer people get out of a calculator, because the mode is usually a two-letter hint in a corner. Here it is on the display, in the answer line, and beside every line of the worksheet.
It is 0.30000000000000004. Binary floating point cannot hold a tenth exactly, any more than decimal can hold a third. Most calculators round the display and let you believe otherwise. This one shows the rounded answer and tells you when the exact value differs, because a page arguing that shortcuts should show their errors cannot then hide its own.
Malformed input is rejected, not repaired. 2+, (1+2 and sqrt(-1) produce a message rather than a guess, because a calculator that quietly completes your expression is answering its question instead of yours. There is no eval anywhere in it — the parser is hand-written and only understands what is listed.
The whole thing works without the mouse.
The expression is parsed by a hand-written recursive-descent parser — a tokeniser, then one function per level of precedence. There is no eval and no regular expression pretending to be a grammar, so the only things it can compute are the ones written into it, and anything else is a refusal rather than a surprise.
Precedence runs in the usual order: brackets, then postfix ! and %, then ^, then unary minus, then × and ÷, then + and −. Two details are worth stating because calculators disagree about them:
Powers are right-associative. 2^3^2 is 29 = 512, not 82 = 64. And unary minus binds looser than the power, so -2^2 is −4 while (-2)^2 is 4. Both follow ordinary mathematical convention, and both are places where two calculators sitting side by side will give you different numbers.
Implicit multiplication is accepted: 2(3+4), 2pi and 3sin(0) all work. Angles go through the mode shown on the display, so asin and atan return degrees when the calculator is in degrees.
It is a worksheet, not a line. Real work is a quantity, then something derived from it, then a total — and a one-line calculator makes you either retype values or trust a number you can no longer see. Name anything with b = 0.047 and every line below can use it; change the top line and the whole sheet re-runs. Names are case-insensitive, a value you define beats a built-in constant of the same name, and a line starting # is a comment.
Beyond the usual keypad it takes two-argument functions (mod, gcd, lcm, ncr, npr, root, logbase, hypot, atan2), lists (min, max, sum, mean, median, range), hex, binary and octal input (0xFF, 0b1011, 0o17) and the physical constants an engineering answer usually needs — c, g, h, k, na, r, atm. An integer answer is shown in hex and binary as well; a tidy fraction is named as one.
calc_model.py is the same grammar written a second time in Python, independently — a different tokeniser, a different recursive descent — and the two are held together by a shared list of 70 expressions that both must evaluate identically, plus 19 malformed inputs both must refuse, driven through this page in the browser. Agreeing answers mean the grammar agrees, rather than that the code was copied.
If you are unsure how something will group, put brackets round it. They are free, they never change a correct answer, and they turn an argument with the machine into a statement of what you meant.
Not after. A wrong angle mode produces a plausible number rather than an error, which is why it survives to the end of the calculation and sometimes into the built thing.
Rounding partway and carrying the rounded value forward is how a small error becomes a visible one. Keep the full value in ans and round the answer you write down.
This calculator, like every calculator in a browser, works in binary doubles. For a one-off sum that is fine. For accounts, work in whole pence with integers — the 0.1 + 0.2 problem is exactly the one that produces a penny out on an invoice.
Releases in which this page changed, newest last. Derived from the archived copy of every release, not from notes written afterwards — so it reflects what actually shipped. Site-wide passes are left out; they are in the full changelog.