Math Expression Evaluator
Evaluate free-form math expressions with functions, constants and degree-based trig — one per line, with variables. 100% in your browser, no upload
Supported: sin, cos, tan, sqrt, log(x, base), ln, abs, round(x, digits), min, max, pow, gcd, lcm, nthRoot, median, PI, E
Tip: ^ is power, and a deg suffix means degrees — sin(45deg) works.
One expression per line, and each line is worked out on its own. A name given a value — a = 2 — is in scope on the lines below it.
🔒 Runs in your browser — nothing is uploaded.
Evaluate any math expression
Type a formula and watch the answer update live as you type. The evaluator understands operator precedence, parentheses, the ^ power operator and the % remainder, plus a full set of functions and constants: sin, cos, tan, sqrt, log, ln, abs, round, min, max, pow, gcd, lcm, nthRoot and median, together with the constants PI and E. log and round take an optional second argument, so log(8, 2) is 3 and round(2.567, 2) is 2.57. Trigonometry can be entered in degrees by adding a deg suffix to a number, so sin(45deg) is read as 45 degrees rather than 45 radians. If an expression is incomplete or misspelled, a clear error message appears instead of a wrong or silent result.
Safe and private by design
Expressions are parsed by a dedicated math parser, never by JavaScript eval, so the box can only do math and can never run arbitrary code. Everything happens locally in your browser, so the numbers you calculate are never uploaded or logged. That makes it a fast, trustworthy replacement for a desktop calculator whenever you need functions, constants or degree-based trig. Write one expression per line and each line is worked out on its own; a name given a value — a = 2 — can be used on the lines below it.
Frequently asked questions
How do I calculate trigonometry in degrees?
Add a deg suffix to the number. For example sin(45deg) is evaluated as 45 degrees. Without the suffix, angles are treated as radians, so sin(PI/4) gives the same value.
Which functions and constants are supported?
You can use sin, cos, tan, sqrt, log, ln, abs, round, min, max, pow, gcd, lcm, nthRoot and median, along with the constants PI and E. log with one argument is the natural logarithm, the same as ln; log(8, 2) takes a base and round(2.567, 2) takes a number of digits. Operators include + - * / , the ^ power operator and the % remainder.