Skip to content
Run here 100% in your browser, no upload, no login

Math Expression Calculator

Evaluate math expressions locally with functions, constants, powers and precise error positions.

Operators: + - * / % ^ ( ) · Functions: sqrt pow sin cos tan log log2 ln abs round floor ceil · Constants: pi e · Trig uses radians

Result —

 

How to use it

  1. Type an expression such as sqrt(2)^2 + sin(pi/2) * 10 into the input.
  2. The result updates as you type - no button press needed.
  3. Operators available: + - * / % (remainder) and ^ for powers, right-associative.
  4. Functions: sqrt, pow, sin, cos, tan, log (base 10), log2, ln, abs, round, floor, ceil. Trig functions take radians.
  5. On error, the message appears with a caret marking the exact character position.

Common use cases

Why it stays private

The expression is parsed and evaluated by a small recursive-descent parser inside the page - the code never touches eval or Function. Nothing leaves your browser and nothing is stored.

FAQ

Q: Are sin, cos and tan in degrees or radians? A: Radians. Use pi for conversions, for example sin(pi/6) is 0.5.

Q: What happens with division by zero? A: The parser reports "Division by zero" instead of showing Infinity or NaN.

Q: Why is 2^3^2 evaluated as 2^(3^2)? A: The power operator is right-associative, matching common mathematical convention, so 2^3^2 equals 512, not 64.

Your data stays on this device

Math Expression Calculator runs 100% locally. Everything you paste or drop is processed by your own browser and never transmitted. Nothing is stored on our servers — close the tab and it is gone.

Nothing you type is sent to a server, logged, or used for analytics. The page works even with your network disconnected after first load.