GRAPH STUDIO / FUNCTION CANVAS

Function grapher: type an expression, watch the curve grow

sin(x), x^2-2*x, abs(x), sqrt(x) - all fair game. Overlay four curves on one grid, toggle dashed derivatives and zero markers, tune the ranges and sampling, then export a PNG.

Functions and view settings live only in this browser on your device. Nothing is uploaded and there's no account. Switching browsers or clearing site data will lose them; use Clear my data in the footer to delete them for good.

Coordinate plane Move the pointer to inspect any point
Hover over the graph to read x and f(x)
01 / FACTS

Parameters and limits

InputSingle-variable expressions: + - * /, power ^, parentheses, |x| absolute value, implicit multiplication such as 2x, and pi / e / tau constants
Functionssin cos tan asin acos atan sinh cosh tanh sqrt abs exp log ln log10 floor ceil round sign min max pow atan2
ProcessingA hand-written recursive descent parser compiles the expression into ordinary closures - no eval or new Function; Canvas drawing stays local, nothing uploaded
Defaultsx in [-8, 8], y in [-5, 5]; 120–1600 samples (default 640); up to 4 functions
LimitsAt most 12 zero markers per curve; derivatives use a central difference, so numerical error grows when zoomed very deep
Known edgesNo complex numbers or piecewise conditions; curves break outside the domain (e.g. negative x for sqrt); no substitution or equation systems
02 / FAQ

Common questions

Does this page use eval to parse functions?

No. The page ships a recursive descent parser: it tokenises the expression into numbers, identifiers and operators, builds a syntax tree by precedence, then compiles that tree into ordinary JavaScript closures. Neither eval nor new Function is used.

Why does the curve break outside the domain?

On purpose. sqrt(x) has no real result below zero, log(x) none at or below zero, and tan(x) shoots to infinity near its poles. Whenever a sampled point yields NaN or infinity, the path is broken instead of faking a continuous line.

How are derivatives and zeros marked?

The derivative is a numerical approximation using the central difference [f(x+h)-f(x-h)]/(2h), with h derived from a tiny slice of the current x span; turn on Derivatives to see it as a dashed line. Zeros are found by scanning adjacent samples for a sign change and interpolating the crossing - an approximation, not an exact root solver.

Where are my functions saved?

Only in this device's browser localStorage so the graph is there next time. The page sends no requests and needs no account. Switching browsers or clearing site data removes it; Clear my data in the footer deletes it deliberately.