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
- Type an expression such as
sqrt(2)^2 + sin(pi/2) * 10into the input. - The result updates as you type - no button press needed.
- Operators available: + - * / % (remainder) and ^ for powers, right-associative.
- Functions: sqrt, pow, sin, cos, tan, log (base 10), log2, ln, abs, round, floor, ceil. Trig functions take radians.
- On error, the message appears with a caret marking the exact character position.
Common use cases
- Quick checks while coding - verify a formula before pasting it into source code.
- Study and homework - evaluate nested expressions like
(1+0.05)^12step by step. - Unit and finance math - compound growth, percentage chains and logarithmic scales.
- Spreadsheet formula prototyping - try the math before writing the cell formula.
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.