Online scientific calculator
Scientific calculator with trig in degrees or radians, logs, powers, roots, factorials, memory keys, parentheses and a full history tape.
- Runs in your browser
- Nothing you enter is sent
- Free, no account
Angle mode applies to sin, cos, tan and their inverses. ans is the previous result and mem is the stored memory value; both can be typed directly. A trailing % divides by 100, so 50% is 0.5.
Nothing calculated yet — your results will be listed here.
How to use it
Type an expression into the box and press Enter, or use the keypad. The result appears as you type, so you can see a running answer before you commit. Everything is expression-based rather than button-sequence based, which means you can read back exactly what you calculated — and edit it.
- Enter — evaluate and add the line to the history tape.
- Escape — clear the expression.
- Typing anywhere on the page — jumps into the expression box.
- Clicking a history line — loads that expression back for editing.
Functions the parser understands
| Category | Names | Example |
|---|---|---|
| Trigonometry | sin, cos, tan, asin, acos, atan, atan2 | sin(30) → 0.5 in degree mode |
| Hyperbolic | sinh, cosh, tanh, asinh, acosh, atanh | cosh(1) |
| Logs and powers | ln, log, log2, log10, exp | log(2, 1024) → 10 |
| Roots | sqrt, cbrt, root(n, x) | root(5, 32) → 2 |
| Rounding | round, floor, ceil, trunc, abs, sign | round(3.14159, 2) → 3.14 |
| Other | mod, min, max, hypot, fact | hypot(3, 4) → 5 |
| Constants | pi, e, tau, phi | 2pi → 6.28318530718 |
| Memory | ans, mem | ans * 2 |
log(x) with one argument is the base-10 logarithm; with two arguments,
log(base, x), it is the logarithm in that base. Multiplication can be implicit:
2(3+4), 3pi and 2sin(45) all work. A trailing ! is
factorial and a trailing % divides by 100, so 50% is 0.5 and
5! is 120.
Operator precedence
- Brackets
- Function calls, factorial and percent
- Powers (
^), evaluated right to left, so2^3^2is 2⁹ = 512 - Unary minus
- Multiplication and division, left to right
- Addition and subtraction, left to right
Note that -2^2 is −4, following the usual mathematical convention that the power binds
more tightly than the sign. Write (-2)^2 if you want 4.
Degrees and radians
The DEG/RAD key switches the angle mode for sin, cos, tan and their inverses. In degree mode
sin(30) is 0.5; in radian mode it is −0.988. Every line in the history tape records which
mode was active, so a tape you copy later is unambiguous. Hyperbolic functions are unaffected — their
argument is never an angle.
Values that should be exactly zero, such as sin(180) in degree mode, are snapped to 0
rather than left as 1.2 × 10⁻¹⁶. Genuine asymptotes such as tan(90) report an error instead
of returning a huge meaningless number.
Using the memory keys
| Key | What it does |
|---|---|
| MS | Store the current result in memory, replacing what was there |
| MR | Insert mem into the expression, recalling the stored value |
| M+ | Add the current result to the stored value |
| M− | Subtract the current result from the stored value |
| MC | Clear the memory back to zero |
The stored value is always visible next to the result, so you never have to wonder what is in memory.
No eval, and no network
The expression is processed by a tokeniser and a recursive-descent parser written specifically for this
page — there is no call to eval and no Function constructor anywhere. That has
two practical benefits: arbitrary code in the input box cannot do anything, and syntax errors can point
at the exact character that broke instead of throwing a browser exception. Arithmetic uses IEEE 754
double precision, roughly 15 significant digits, and results are displayed to 12 digits so that
floating-point dust such as 0.30000000000000004 does not leak into the answer.
Nothing is transmitted: no keystrokes, no results, no history. Close the tab and the tape is gone.
Questions
Can I type instead of clicking?
Yes. The expression box takes full keyboard input including function names like sin, ln and sqrt. Enter evaluates, Escape clears, and every key on the pad has a keyboard equivalent.
Does it work in degrees or radians?
Both. The toggle above the keypad switches the angle mode for sin, cos, tan and their inverses, and the current mode is recorded next to each entry in the history tape.
How does the memory work?
MS stores the current result, MR recalls it into the expression, M+ and M− add or subtract the result from the stored value, and MC clears it. The stored value is always visible.
Is the expression parser safe?
It is a hand-written tokeniser and recursive-descent parser — no eval, no Function constructor. It also means syntax errors point at the character that broke, instead of throwing.
What precision does it use?
IEEE 754 double precision, the same as every other JavaScript calculator, giving about 15 significant digits. Results are displayed to 12 digits to hide floating-point dust.