# Math Expression Evaluator

URL: https://phishdestroy.io/developer-tools/math-expression-evaluator
Category: Misc
Where it runs: Runs locally (nothing you enter is uploaded)

Type an arithmetic expression and press Evaluate or Enter. It understands the basic operators, powers, remainders, parentheses and a short list of Math functions and constants.

## Example input

Area of a circle with radius 2

```
Math.PI * 2 ** 2
```

Returns 12.566370614359172 (π × 2²); ** is applied before *.

## FAQ

### What can I type?

Numbers (including forms like 1e3), + - * / ** and % (remainder, not percent), parentheses, and functions written with the Math. prefix: Math.sin, cos, tan, sqrt, abs, floor, ceil, round, log (natural logarithm) and pow, plus Math.PI and Math.E. There are no variables, and angles are in radians.

### Why is a result like 0.1 + 0.2 slightly off?

Results are JavaScript 64-bit floating-point numbers shown without rounding, so 0.1 + 0.2 gives 0.30000000000000004. Division by zero gives Infinity and Math.sqrt(-1) gives NaN.

### Is the expression executed as code or sent anywhere?

No. A small parser in the page reads only the allowed syntax instead of using eval(), and the calculation runs in your browser without any upload.

## Related tools

- [Percentage Calculator](https://phishdestroy.io/developer-tools/percentage-calculator)
- [Number Base Converter](https://phishdestroy.io/developer-tools/number-base-converter)
- [Roman Numeral Converter](https://phishdestroy.io/developer-tools/roman-numeral-converter)
- [Temperature Converter](https://phishdestroy.io/developer-tools/temperature-converter)
- [Duration Converter](https://phishdestroy.io/developer-tools/duration-converter)

All tools: https://phishdestroy.io/developer-tools
