01What is Math Evaluator?
Math Evaluator works out expressions typed in ordinary notation, like (3 + 4) * 2^3 / sqrt(16), and shows the answer as you type. It is meant for the moments when a phone calculator gets clumsy and opening a REPL feels like too much. It never passes your text to JavaScript's eval or Function. A small tokenizer splits the input, a recursive-descent parser builds a tree, and only the operators and functions on its list can run. That list is + - * / % and ^ for power, parentheses, unary plus and minus, the constants pi, e and tau, and the functions sqrt, sin, cos, tan, asin, acos, atan, log, ln, exp, abs, ceil, floor and round. log is base 10 and ln is the natural log. Precedence follows normal math rules. ^ binds tightest and groups right to left, then the sign, then * / %, then + and -. So 2^3^2 is 2^9, which is 512, and -2^2 is -4. A number written right before a constant or function multiplies it, so 2pi works and gives 6.283185307. Here is a worked example. Type (3 + 4) * 2^3 / sqrt(16) and the result is 14. The steps panel lists 3 + 4 = 7, 2 ^ 3 = 8, 7 * 8 = 56, sqrt(16) = 4 and 56 / 4 = 14, in the order the tree is evaluated. Unary minus does not get its own step, so -2^2 only shows 2 ^ 2 = 4. Errors are specific. You will see Unknown identifier for a name it does not know, Expected ")" for an unclosed bracket, Division by zero or Modulo by zero, and a not-finite message for results like sqrt(-1). Press Enter or = to save the expression to a history of your last 10 calculations. Click a history entry to load it again, or copy any result. Numbers are IEEE 754 double-precision floats, the same as JavaScript. Results are rounded to 10 significant digits for display and whole numbers get thousands separators. That hides some float noise: 0.1 + 0.2 shows as 0.3, while the step reads 0.30000000000000004. It cannot hide everything, so sin(pi) shows 1.224646799e-16, not 0. Trig works in radians only, and there are no variables, no two-argument functions like pow or max, and no big-number mode. History lives in page memory and is cleared on reload.
Developers and students who want to check an arithmetic or trig expression with clear precedence and visible steps, without running code. The tool runs entirely in your browser, so your data never leaves your device.
02How to use Math Evaluator
- Type an expression in the input, or click a quick-insert button such as sqrt( or pi.
- Read the live result, or the error message if the expression is incomplete.
- Open the steps panel to see each intermediate calculation in evaluation order.
- Press Enter or = to add the calculation to History.
- Click a History entry to load it again, or copy the result.
03Worked examples
- Input:
2^3^2 - Result:
512 (steps: 3 ^ 2 = 9; 2 ^ 9 = 512) - Powers group right to left, so this is 2^(3^2).
- Input:
-2^2 - Result:
-4 (steps: 2 ^ 2 = 4) - The power binds tighter than the leading minus. The negation itself is not listed as a step.
- Input:
(3 + 4) * 2^3 / sqrt(16) - Result:
14 (steps: 3 + 4 = 7; 2 ^ 3 = 8; 7 * 8 = 56; sqrt(16) = 4; 56 / 4 = 14) - Steps follow the order the parse tree is evaluated.
- Input:
0.1 + 0.2 - Result:
0.3 (step: 0.1 + 0.2 = 0.30000000000000004) - The display rounds to 10 significant digits, while the step shows the raw float.
- Input:
sin(pi) - Result:
1.224646799e-16 - Floating point pi is not exact, so the sine is a tiny number rather than 0.
- Input:
foo(2) - Result:
Error: Unknown identifier: "foo" - Only the listed functions and constants are accepted. 1/0 gives Division by zero.
04Common use cases
- Checking a formula from a spec, such as a retry delay of 2^5 * 100 ms, before writing it in code
- Working out a nested expression with several brackets that is easy to mistype on a phone calculator
- Showing a junior developer why -2^2 is -4 by walking through the steps panel
- Converting degrees to radians inline, as in sin(30 * pi / 180), while checking a geometry calculation
- Spotting floating point surprises by comparing the rounded result with the full value in the steps
- Confirming how % handles negative numbers in JavaScript before porting code from Python
05Tips
- 2^3^2 is 512, not 64, because powers group right to left. Add parentheses if you mean (2^3)^2.
- % keeps the sign of the left number, as JavaScript and C do, so -7 % 3 is -1. Python gives 2 for the same input.
- The displayed result is rounded to 10 significant digits. Check the steps panel when you need the full float value.
- sqrt of a negative number or asin(2) gives a not-finite error rather than a complex number.
06Related concepts
Expression parser, Recursive descent, Infix notation, Operator precedence.
Frequently Asked Questions
What is Math Evaluator?
Math Evaluator is a free, browser-based developer tool on AIDToolStack. Evaluate math expressions safely with functions, constants, and history. It requires no installation or sign-up and works entirely in your browser.
Is Math Evaluator free to use?
Yes. No sign-up, no fees and no usage cap.
Does Math Evaluator store my data?
No. It runs in your browser; nothing is uploaded.