Math Evaluator
Evaluate mathematical expressions with functions, variables and units.
Type any expression — arithmetic, trig, logarithms, unit-aware physical calculations — and get the result instantly. Variables persist across lines so you can build up complex calculations without nesting everything into one expression.
Common use cases: quick engineering estimates, sanity-checking a formula before coding it, doing unit conversions inside a larger calculation, and using the browser tab as a programmable calculator without launching a heavyweight CAS.
Supported operations:
Basic: + - * / ()
Examples: 2+2, (10-5)*3, 100/4
Frequently asked questions
What can the evaluator parse?
Arithmetic with proper operator precedence, parentheses, common functions (
sin, cos, tan, log, ln, sqrt, abs, floor, ceil, round), constants (pi, e), exponentiation (^), modulo (%), and unit-aware expressions.Why does 0.1 + 0.2 not equal 0.3?
Floating-point arithmetic represents most decimals as the nearest binary approximation, and 0.1 has no exact binary form. The result is
0.30000000000000004. For financial calculations, multiply by a power of ten and use integers, or use a decimal library like big.js.Can I use variables and define functions?
Yes — assign values with
x = 5 and reuse them on subsequent lines. The evaluator is stateful within a session, so building up complex calculations step by step works cleanly.Does it handle units like 10cm + 3in?
Yes — unit-aware expressions convert automatically.
10 cm + 3 in resolves to 17.62 cm; 60 mph in km/h gives 96.56 km/h. Useful for quick physical calculations without context-switching to a unit-conversion tool.