Function Grapher: Plot Multiple y=f(x) Curves and Save as PNG
Type an expression in x and the graph is drawn right away. Overlay up to six colored curves, drag to pan, and zoom with the mouse wheel or the "Zoom in" and "Zoom out" buttons. Curves are broken at discontinuities such as 1/x or tan(x) instead of drawing a false line across them. Parsing and drawing both happen in your browser, so your expressions are never sent to a server. Looking for roots instead? Try the Quadratic Equation Solver.
🔒 Runs in your browser · Your data is never sent to a server
Supported functions and operators
Functions
- sin(x) cos(x) tan(x)
- Trigonometric functions, in degrees or radians per the angle setting
- asin(x) acos(x) atan(x)
- Inverse trig functions; results use the selected angle unit
- atan2(y, x)
- Two-argument arctangent
- sinh(x) cosh(x) tanh(x)
- Hyperbolic functions
- sqrt(x) √x
- Square root (parentheses optional, as in √2)
- cbrt(x)
- Cube root
- abs(x)
- Absolute value
- exp(x)
- e raised to the power x
- ln(x)
- Natural logarithm (base e)
- log(x) log(x, b)
- Base-10 logarithm; pass a second argument for another base
- log10(x) log2(x)
- Base-10 and base-2 logarithms
- floor(x) ceil(x)
- Round down / round up
- round(x)
- Round to the nearest integer
- trunc(x)
- Drop the fractional part (toward 0)
- sign(x)
- Sign (-1, 0 or 1)
- fact(x)
- Factorial (whole numbers 0 to 170)
- pow(a, b)
- a raised to the power b
- mod(a, b)
- Modulo (never negative)
- min(a, b, …) max(a, b, …)
- Smallest / largest value (up to 8 arguments)
Operators and notation
- + - * /
- Arithmetic (full-width × ÷ − + also work)
- a^b
- Power; 2^3^2 is evaluated right to left as 2^(3^2)
- n!
- Factorial
- n%
- Divide by 100 (50% = 0.5)
- 2x 2(x+1) 2pi
- The multiplication sign can be omitted
Constants and variables
- pi π
- Pi
- e
- Euler's number
- tau
- 2π
- x
- The horizontal-axis variable
How to use
- Type the right-hand side of y=f(x) into "Functions" (for example sin(x), x^2/4 or 1/x). Fill several boxes to overlay colored curves.
- Switch "Angle unit" if you want trigonometric functions in degrees, and set the x and y limits under "View range".
- Drag the graph to pan, and use the mouse wheel or "Zoom in" / "Zoom out" to change the scale. Press "Reset" to go back.
- Press "Save as PNG" to save the currently visible area as an image.
Notes
- Operators: + - * / ^ plus postfix ! and %. Implicit multiplication such as 2x or 2(x+1) works too.
- Functions: sin cos tan asin acos atan sinh cosh tanh sqrt cbrt abs exp ln log log2 log10 floor ceil round trunc sign pow mod min max. Constants: pi and e.
- ln is the natural logarithm and log is base 10 (use log(x, b) for another base).
- The line breaks where the function is undefined, such as division by zero or the square root of a negative number, and across vertical asymptotes like tan(x).
- Curves are sampled at fixed steps and drawn as polylines, so extremely fast oscillations such as sin(1000x) may not be drawn accurately.
- The image is drawn on a white background and looks the same in dark mode.
Glossary
Asymptote
A line that a curve approaches forever without touching it. 1/x has one at x = 0 and tan(x) at x = π/2, where the value runs off to positive or negative infinity.
Radian
An angle unit in which 180° equals π radians. Most programming languages and mathematics texts use radians for trigonometric functions by default.
FAQ
What expression syntax is supported?
The only variable is x, and a leading "y=" is optional. You can write x^2, sin(x)/x, sqrt(x), abs(x), 2^x or log(x, 2). Implicit multiplication such as 2x also works.
Why does the line break for tan(x) or 1/x?
Joining points across an undefined value or a vertical asymptote would draw a vertical line that is not part of the function, so the curve is deliberately broken there.
Why is sin(90) not 1?
The angle unit defaults to radians. Switch "Angle unit" to degrees and sin(90) becomes 1. Inverse functions such as asin then return degrees as well.
Which area ends up in the saved PNG?
Exactly what is on screen. Set the "View range", or pan and zoom, before saving. The background is white, even in dark mode.
How many curves can I overlay?
Up to six. Empty boxes are ignored, and a box with an error shows its message while the other curves keep drawing.
Share this page
