Skip to main content

Math Evaluator

Evaluate one or more mathematical expressions, one per line. Supports arithmetic, functions (sqrt, sin, cos, log), units (deg), and matrices via mathjs. Each line is evaluated independently and errors are reported per line.

Input

Output

Result
Was this helpful?

Guides

The Math Evaluator computes the value of mathematical expressions directly in your browser. Type one expression per line and each is evaluated independently — so a mistake on one line never breaks the rest. It is powered by mathjs, a rich expression engine that understands far more than a basic calculator, while staying safe: it parses a restricted math syntax, not arbitrary JavaScript, so nothing you type can execute code.

How to use it

  1. Enter one or more expressions in the input box, one per line.
  2. The result for each line appears in the output box as expression = result.
  3. If a line can't be evaluated, you get a Line N: <reason> message pinpointing exactly which line failed and why.

Copy or download the results with the buttons on the output box.

Supported syntax

The evaluator understands a wide range of mathematical notation:

  • Arithmetic+, -, *, /, % (modulo), and ^ for exponents: 3^2 + 4^225.
  • Parentheses and precedence(2 + 3) * 420.
  • Roots and powerssqrt, cbrt, pow, nthRoot: 2*sqrt(6).
  • Trigonometrysin, cos, tan, asin, acos, atan, and their hyperbolic variants. Combine with the deg unit to work in degrees: sin(45 deg).
  • Logarithmslog, log2, log10, exp. Note that log(x, base) is the logarithm of x in the given base, so log(10, 100) = 0.5 (that is, ln 10 ÷ ln 100). For the base-10 log of 100, write log10(100) or log(100, 10)2.
  • Constantspi, e, phi, tau, Infinity.
  • Rounding & number theoryround, floor, ceil, abs, gcd, lcm, factorial, and the ! operator.
  • Units — attach units like deg, rad, cm, inch, kg; mathjs converts between compatible ones (e.g. 5 cm + 2 inch).
  • Matrices and vectors — build them with matrix([[1,2],[3,4]]) or the bracket shorthand [1, 2; 3, 4], then multiply, transpose, or take the determinant: matrix([[1,2],[3,4]]) * [5,6][17, 39].
  • Variables — assign with x = 5 and reuse the name on later lines.

Examples

Expression Result
2*sqrt(6) 4.898979486
sin(45 deg) + cos(45 deg) 1.414213562
3^2 + 4^2 25
matrix([[1,2],[3,4]]) * [5,6] [17, 39]

Is my input sent anywhere?

No. Every expression is evaluated locally in your browser — nothing is uploaded to a server, which makes the tool fast and private.

Why does one line show an error while the others still work?

Each line is evaluated on its own. An unknown function, an undefined symbol, or a syntax slip only affects that single line; the valid lines around it still return their results.

mathcalculatorevaluateexpressionmatrix

Love the tools? Lose the ads.

One payment clears every ad from your account, for good. No subscription, no tracking.