Calculation Scratchpad

A line-by-line math scratchpad with ans and _1/_2 row references, common math functions and multiple pads, saved automatically in your browser.

FreeOnline Tool
Loading…

How to Use

The scratchpad evaluates one formula per line and shows each result instantly on the right.

  1. Type a formula on any line, such as 1 + 2 * 3, and the result appears immediately. Press Enter to insert a new line below.
  2. Use ans to reference the most recent valid result above the current line, and _1, _2… to reference the results of lines 1, 2 and so on. Invalid lines count as 0.
  3. Click Formula Examples to open the example panel; clicking an example inserts it into the current empty line or creates a new line.
  4. Switch pads with the tabs at the top. Double-click a tab or click ✎ to rename it, click + to add a pad, and click × to delete one (at least one pad is kept).
  5. Click Load Sample Data to create a pad containing compound-interest, function and row-reference examples.
  6. Pads are saved automatically in browser localStorage and survive a page refresh. Click Clear or press Ctrl/⌘+L to clear the current pad.

Features

  • Supports + - * / % ^, parentheses and unary signs, plus ** for exponentiation and implicit multiplication such as 2(3+4) or 2pi.
  • Functions include sin, cos, tan, asin, acos, atan, atan2, sinh, cosh, tanh, asinh, acosh, atanh, ln, log, log10, log2, exp, sqrt, cbrt, abs, pow, min, max, hypot, floor, ceil, round, trunc and sign.
  • Constants include pi, π, tau and e. log is base 10, ln is natural log, and trigonometric functions use radians.
  • round(x, n) rounds to a specified number of decimal places, limited to 0–12.
  • Multiple scratchpads are supported, with renameable and deletable tabs. Ten font sizes from XS to 6XL are available and remembered separately.
  • Integer results use thousands separators, decimals show up to 12 significant digits, and longer values switch to scientific notation.
  • Keyboard shortcuts: Enter for a new line, Ctrl/⌘+D to delete a line, ↑/↓ to move, and Backspace on an empty line to remove it.
  • Formulas run through a custom parser rather than eval or new Function.

Use Cases

Engineering and science calculations
Break a long calculation into lines and reference intermediate values with ans or _1, _2 instead of retyping them.
Financial estimates
Work out compound interest, VAT or averages, and keep each scenario on its own pad for comparison.
Step-by-step homework
Write formulas in solution order, get an instant result per line and keep the full working visible.
Everyday quick math
Handle square roots, logarithms, trigonometry or rounding without switching to a separate scientific calculator.

FAQ

What is the difference between ans and _1, _2?
ans returns the nearest valid result above the current line. _1, _2… reference the results of lines 1, 2… by line number, with invalid lines treated as 0. Both only look at lines above the current one.
Why does log give a different result from my calculator?
Here log is base-10 logarithm; use ln for the natural logarithm. Trigonometric functions take radians, not degrees.
What happens with a negative square root or division by zero?
A NaN result shows “NaN (undefined)”, overflow shows +∞ or -∞, and syntax errors display an error message. Other lines continue to calculate normally.
Where is my data stored, and will a refresh lose it?
Pads and font size are stored in browser localStorage, so a normal refresh keeps them. Private browsing or disabled local storage may prevent saving.
Does the percent sign calculate percentages?
No. % is the modulo operator, so 17 % 5 equals 2. For percentages, write x/100 or x*0.01.
Can I keep several scratchpads at once?
Yes. The tab bar supports creating, renaming and deleting multiple pads, and each pad keeps its own lines and results.