2+3*4 should be 14, not 20. This calculator computes with standard precedence: parentheses first, then multiplication and division, then addition and subtraction. Percent, sign flip, backspace and all-clear are all on the keyboard - and your physical keyboard works too, with results as you type. The engine is a hand-written recursive-descent parser; zero dynamic code execution anywhere.
Everything you type is calculated in this page's memory only - nothing is uploaded and there is no account. The paper-tape history on the right stays in this browser; switching devices or clearing site data loses it. Clear my data in the footer removes it.
| Input | Arithmetic expressions: numbers (decimals included), + − × ÷, parentheses, % (after a number), ± (negative), x10ⁿ (scientific notation); keyboard or on-screen keys |
|---|---|
| Output | Live preview as you type; = commits the result to the paper tape; plain-language errors |
| Key parameters | No options; tape capped at 50 entries (oldest rolls off); ?expr=2%2B3*4 deep-links an expression |
| Processing | Recursive-descent computing in your browser (hand-written parser, zero dynamic execution); expressions never stored or uploaded |
| Limits | Expressions up to 500 characters; numbers within ±1e±308; tape 50 entries |
| Known limits | No scientific functions or fractions; implicit multiplication (2(3+4)) must be written 2*(3+4); dividing by 0 reports an error; two operators in a row keeps only the last |
Click the keypad or just type on your physical keyboard. 0-9 enter digits, + - * / are operators, ( ) parentheses, % percent. Enter or = commits the result to the tape, Backspace deletes a character, Esc clears everything. After a result, pressing an operator keeps calculating from it.
The parser descends through the grammar: expression → additive terms → multiplicative factors → atoms (parentheses, numbers, percent). So 2+3*4 = 14 and (2+3)*4 = 20; 200+10% = 220 (adding 10% is multiplying by 1.1), and a lone 50% is just 0.5.
Feeding user input straight into a dynamic execution call hands the page's privileges to whoever types - the textbook XSS entrance. This calculator's parser is hand-written: it tokenizes against a whitelist grammar, then computes by precedence. An expression here can only ever be math; nothing else executes.
Add, subtract, multiply and divide, parentheses to change precedence, a percent sign that divides the preceding number by 100, a sign-flip key, decimals, and chained operations (3+5 then pressing *2 keeps calculating from the result). Scientific functions, implicit multiplication (2(3+4) must be written 2*(3+4)) and fractions are not supported.
14. The parser follows standard precedence: multiplication and division before addition and subtraction, parentheses first. To add before multiplying, write (2+3)*4, which gives 20.
50% means 50/100 = 0.5, so 200*50% = 100 and 200+10% = 220 (adding 10% is multiplying by 1.1). Put the percent sign right after a number; 50%% is not supported.
No. All calculation happens in this device's browser - there is no upload endpoint and the page works offline. The paper-tape history lives in this browser's localStorage; Clear my data in the footer removes it in one click.