Graphing Calculator
Plot functions, zoom and trace — with the maths parsed, not evaluated.
Drag to pan, scroll to zoom. Use x as the
variable — sin(x), x^2, sqrt(x),
ln(x), abs(x), pi, e.
How it works
The expression you type is parsed, not evaluated. It is converted to postfix with the shunting-yard algorithm and then run through a small stack machine, which means nothing you enter can execute as code — no `eval`, and no gap for a content security policy to have to cover.
Plotting samples the function once per screen pixel. Where consecutive samples jump further than the height of the viewport, the line is broken rather than drawn: that keeps a vertical asymptote from being rendered as a near-vertical line, which is the single most common bug in a hand-rolled grapher and turns `tan(x)` into something that looks continuous when it is not.
Common questions
What can I type?
Arithmetic with + - * / ^ and brackets, and the functions sin, cos, tan, asin, acos, atan, sqrt, cbrt, abs, ln, log, exp, floor, ceil, round, sign, min and max. Constants pi and e. Angles are in radians. Implicit multiplication works, so 2x and 3sin(x) parse as you would expect.
Why is my graph empty?
Usually the function is real-valued nowhere in the visible window — sqrt(x) for negative x, or ln of a non-positive number. Both are undefined over the reals and nothing is drawn. Try widening the x range.
Does anything I type get sent anywhere?
No. The parser, the sampler and the canvas all run in your browser. The page makes no network request after it loads.