Scientific Calculator
Evaluate complex expressions in your browser: arithmetic, powers and roots, trigonometry, logarithms, factorials and parentheses, with live preview and fully local computation.
A phone calculator only offers a scientific keypad in landscape, and a desktop has nothing until you search for one — so this page is worth a bookmark. Enter the expression as you would write it: the four operations, powers and roots, trigonometry, logarithms, factorials and brackets, with the result previewed as you type. Everything is computed locally, so nothing is sent anywhere and nothing is stored.
Trigonometry defaults to degrees; switch to radians for calculus and programming work, because sin(30) is a completely different number in the two modes. Expressions follow the standard precedence rules, with brackets first and powers right-associative — when in doubt, add a pair of brackets. A tail such as 0.30000000004 is binary floating point behaving normally, not a mistake.
Did this tool solve your problem?
Submitting sends the tool name, your input and the current result to the server. Please do not include ID numbers, phone numbers or other private data.
AI assistant It answers using your current input and result
Asking again sends your current input and result to the server once more. Please do not include private data.
How to use
- Type an expression using the keypad or the keyboard.
- Watch the preview update as you type.
- Switch between degrees and radians before using any trigonometric function.
- Split long expressions into steps and keep intermediate values when checking.
How it works
Keyboard and input
Type an expression directly or tap the on-screen keys; press = or Enter to evaluate, with a live preview while typing. AC clears everything, DEL removes the last character.
Which operations are supported
Supports + − × ÷, power ^, parentheses, factorial !, percent %, plus sin/cos/tan, asin/acos/atan, ln/log/log2, sqrt, and the constants pi and e. Implicit multiplication works: 2pi, 2(3+4) and 3sin(30) all parse.
DEG vs. RAD
DEG means degrees, RAD means radians; the default is DEG. The toggle affects only trigonometric and inverse trigonometric functions: sin(30) = 0.5 in DEG, sin(pi/2) = 1 in RAD.
Precision and limits
Results are computed in double precision, displayed with 12 significant digits and float tail error removed; results beyond 10^12 or below 10^−9 switch to scientific notation automatically.
Code example
JavaScript Evaluating an expression safely
// Never eval directly (a security risk) — construct a Function and whitelist the characters:
function calc(expr) {
if (!/^[0-9+\-*/(). ^%!a-z]+$/i.test(expr)) throw new Error("illegal characters");
const js = expr
.replace(/\^/g, "**")
.replace(/sin\(/g, "Math.sin(")
.replace(/cos\(/g, "Math.cos(")
.replace(/ln\(/g, "Math.log(");
return Function("\"use strict\";return(" + js + ")")();
}
calc("2^10"); // 1024
Python Safe evaluation with ast
import ast, operator
OPS = {ast.Add: operator.add, ast.Sub: operator.sub,
ast.Mult: operator.mul, ast.Div: operator.truediv,
ast.Pow: operator.pow}
def calc(node):
if isinstance(node, ast.Num): return node.n
if isinstance(node, ast.BinOp): return OPS[type(node.op)](
calc(node.left), calc(node.right))
raise ValueError("unsupported expression")
calc(ast.parse("2**10", mode="eval").body) # 1024
FAQ
How does this differ from my phone's calculator?
Phone calculators usually offer only basic arithmetic. This tool provides trigonometric functions, logarithms, powers and roots, factorial and parentheses right in a web page — no app install, works on desktop and mobile browsers. All computation happens locally; expressions are never uploaded.
Which operators and functions are supported?
Operators: + − × ÷ and the right-associative power ^, plus unary signs and parentheses. Functions: sin cos tan asin acos atan sinh cosh tanh ln log lg log2 sqrt cbrt abs exp floor ceil round sign fact; constants pi, e, tau; postfix ! and %. Implicit multiplication is allowed — 2pi, 2(3+4), 3sin(30) are all valid.
DEG or RAD — which should I pick?
DEG computes in degrees, RAD in radians; default DEG. Use DEG for school problems and engineering estimates, RAD for work involving π. The toggle affects inverse functions too: asin(0.5) is 30 in DEG and 0.523598775598 in RAD.
How does the % key compute?
Here % is a postfix meaning "divide by 100": 50% = 0.5 and 200+10% = 200.1. This differs from some phone calculators' add-on semantics (200+10% → 220); for a markup, write 200*(1+10%) explicitly. This convention gap is the single most common calculator confusion.
What are the factorial limits?
Factorial accepts non-negative integers from 0 to 170. Negatives and decimals are out of domain, and 171+ is rejected because it overflows double precision (about 1.8×10^308) — better than returning a meaningless Infinity.
How precise are the results?
Computation uses double precision; the display keeps 12 significant digits with float tail error removed, so 0.1+0.2 shows 0.3 rather than 0.30000000000000004. Results beyond 10^12 or below 10^−9 switch to scientific notation — 2^100 = 1.2676506002e30, for instance.
Why does tan(90) produce an error?
Tangent is undefined at 90° (cos 90° = 0, effectively dividing by zero), so the tool reports out of domain instead of returning a giant number. Likewise sqrt(-1), ln(0) and asin(2) error out — none has a real solution.
Are my expressions saved or uploaded?
Not uploaded. Expressions are evaluated by local scripts in your browser; the server only delivers the page. History is kept in your browser's localStorage — clear it from the history panel, or use an incognito window to leave no trace.