Toolbox OnlineToolbox Online

Expression Calculator

Type a math expression and get instant results with trigonometry, logs, powers and factorials.

Private by design: everything runs locally in your browser. Nothing is uploaded.
Scientific calculatorMath expressionTrigonometry

Evaluate an expression

Enter a math expression with parentheses, powers, factorials, trigonometry or logs, then press Enter.

Angle mode
Examples

Supports + - * / % ^ ! and parentheses, plus sin, cos, tan, asin, acos, atan, sqrt, cbrt, abs, ln, log, log2, log10, exp, ceil, floor, round, sign, min, max, pow, hypot and fact.

Constants: pi, e and tau. Exponentiation binds tighter than unary minus, so -2^2 is -4.

History

History is stored locally in your browser and keeps the last 8 entries.

No calculations yet.

    How it works

    1. 1Type an expression such as (12+8)*3/4 or sin(30), or use the symbol buttons below the input to insert functions and constants.
    2. 2Press Enter or click Calculate. A recursive descent parser evaluates the expression by precedence, without eval.
    3. 3Trigonometric functions use degrees by default, and switching to radians recalculates the current expression in that mode.
    4. 4The result is formatted and stored in local history; click any history row to load that expression and mode again.

    Frequently asked questions

    Which operators and functions are supported?

    Operators include +, -, *, /, % (remainder), ^ (power) and ! (factorial), with nested parentheses. Functions include sin, cos, tan, asin, acos, atan, sqrt, cbrt, abs, ln, log, log2, log10, exp, ceil, floor, round, sign, min, max, pow, hypot and fact.

    Do trigonometric functions use degrees or radians?

    Degrees by default, which matches everyday use. Switch to radians and sin, cos, tan and their inverses all use radians; each history row records the mode used for that result.

    Why is -2^2 equal to -4?

    Exponentiation binds tighter than a unary minus, so -2^2 is parsed as -(2^2) and equals -4. To square negative two, write (-2)^2.

    How precise are the results?

    Calculation uses JavaScript double precision floating point, usually 15 to 17 significant digits. Results are formatted to hide floating point noise, but extreme values can still hit floating point limits.

    Is my expression uploaded?

    No. Parsing, evaluation and history all run locally in your browser with no network requests, so the tool also works offline.

    Which constants can I use?

    pi, e and tau are available, and you can also spell out pi and tau. They behave like ordinary numbers in any expression.

    More tools in this category

    More online tools