Math Expression Evaluator
Safely evaluate multi-line math with functions, variables, BigInt, and four result formats.
How to use
Enter one expression per line. Define variables first with assignments such as x = 3, then reuse them below. Operators are + - * / % ^; exponentiation is right-associative. Functions include square root, trigonometry, logarithms, rounding, min/max, and pow; pi and e are built in. Choose BigInt for integer-only arithmetic beyond Number precision—division truncates, and trigonometric or logarithmic functions are unavailable. Results can be decimal, hexadecimal, binary, or scientific notation. Parsing is implemented directly and never invokes eval or Function.
FAQ
Is it safe to paste untrusted expressions?
The parser recognizes only its documented numbers, names, operators and functions. It does not execute JavaScript or access browser APIs.
What do log and ln mean?
Both log and ln are natural logarithms. Use log10 for base 10 and log2 for base 2.
Why does BigInt division drop the remainder?
JavaScript BigInt division is integer division and truncates toward zero. Use the percent operator to inspect the remainder.