Skip to main content

Math Expression Evaluator

New

Evaluate mathematical expressions safely — supports arithmetic, trig, logs, sqrt, and more.

mathcalculateexpressionevaluateformula
Read the guide
Shortcuts:⌘ KSearch

Math Expression Evaluator

Evaluate mathematical expressions safely — supports arithmetic, trig, logs, sqrt, and more.

Supports + - * / ^ % sqrt() sin() pi n! and more.

Press Enter to evaluate.

Enter an expression to calculate.

Last 10

No calculations yet.

Frequently Asked Questions

Is this using JavaScript eval under the hood?

No. It uses a custom parser with separate expression, term, power, unary, postfix, and primary parsing steps. That means it only supports the operators and functions explicitly coded into the parser.

Why does sin(90) not return 1?

Because the trig functions come straight from JavaScript's Math object, which uses radians. For 90 degrees, use sin(pi/2) instead.

What functions and operators are actually supported?

The parser handles +, -, *, /, %, ^, parentheses, unary +/-, postfix factorial, constants pi and e, and single-argument functions sqrt, abs, floor, ceil, round, sin, cos, tan, log, and exp. Anything outside that list is rejected as an unknown function or token.

Why does 2(3+4) or 1e3 fail?

This parser does not implement implicit multiplication or scientific-notation numbers. You need to write 2*(3+4), and exponent notation like 1e3 isn't recognized by its number parser.

Why does factorial fail on values like 5.5 or -1?

Because factorial is deliberately limited to non-negative integers. If the value isn't an integer or is below zero, the tool throws a specific factorial error instead of approximating it.

Related Tools