Function Plotter
Graph up to three functions of x on an interactive canvas — drag to pan, scroll to zoom, double-click to reset.
Functions to plot
Syntax: + - * / ^ (power), functions sin cos tan exp log ln sqrt abs, constants pi e. Examples: x^2, sin(x)/x, exp(-x^2).
How it works
Each expression is parsed once by a safe recursive-descent parser (no eval), then sampled at over a thousand points across the visible x-range. Points where the function is undefined (division by zero, square root of a negative number) are skipped, and the curve is broken wherever it jumps by more than 50× the visible y-range — so vertical asymptotes render as clean gaps instead of misleading spikes. The y-axis auto-fits to the sampled values, clamped to ±10⁶.
Frequently asked questions
What syntax can I use for functions?
Operators + - * / and ^ for powers (right-associative, so 2^3^2 is 2⁹), parentheses, and the functions sin cos tan asin acos atan exp log ln sqrt abs with constants pi and e. Unary minus binds looser than ^, so -3^2 means −9, as in standard math.
Why does my graph have gaps or missing pieces?
Gaps appear exactly where the function has no finite value — for example at the asymptote of tan(x) or the pole of 1/(x-2). Those points are skipped on purpose; a continuous line through them would be wrong.
Why does 1/x fail with "division by zero"?
Every expression is validated by evaluating it at x = 0 and x = 1 before plotting, so functions that blow up at those exact points (like 1/x or log(x) at 0) are rejected up front. Nudge the expression, e.g. 1/(x+0.001), and it will plot.
Is anything I type sent to a server?
No. Parsing, sampling and rendering all happen locally in your browser with plain JavaScript — nothing you type ever leaves your device.