Online Graphing Calculator
An online graphing calculator for functions of x. Type one function per row, such as x^2 - 2, sin(x) or 1/x, and each is drawn in its own colour on a graph you can drag and zoom. The calculator finds the roots, the y-intercepts, where any two graphs intersect and the local maxima and minima in the part you are looking at, lists them and marks them on the graph, and gives a table of values you can copy as CSV.
How to graph a function
- Type a function in the first
Functionfield, such asx^2 - 2ory = 3sin(2x). Write it as on paper:2xfor 2 times x,x²orx^2,sin x,e^-x,sqrt(x)or√x,|x|,log_2(x),pi. - Press
Add functionfor another graph. Each row has its ownColour, aShowbox to hide it for a moment, and a remove button. A row that cannot be read says why under the field. - Drag the graph to move it, scroll or pinch to zoom, or use the zoom buttons above it;
Reset viewgoes back to x from -10 to 10. With the graph focused, the arrow keys move it, + and − zoom and 0 resets. - Read
Points in viewunder the graph: each root, intersection and turning point with its coordinates. Tap a marker on the graph, or the show button in its row, to see its coordinates on the graph. - Set
From x,To xandStepinTable of values, thenCopy CSVorDownload CSV.Downloadabove the graph saves a PNG or SVG picture;Copy linkcopies a link that opens the same graph.
Example
The example the page opens with: a cubic and a sine wave, x from -4 to 4. Every point is found and marked without pressing anything.
y = x^3 - 3x
y = 2sin(x)Root of f2: (−3.14159, 0)
Intersection of f1 and f2: (−1.98131, −1.83384)
Root of f1: (−1.73205, 0)
Local min of f2: (−1.5708, −2)
Local max of f1: (−1, 2)
Root of f1: (0, 0)
y-intercept of f1: (0, 0)
Root of f2: (0, 0)
y-intercept of f2: (0, 0)
Intersection of f1 and f2: (0, 0)
Local min of f1: (1, −2)
Local max of f2: (1.5708, 2)
Root of f1: (1.73205, 0)
Intersection of f1 and f2: (1.98131, 1.83384)
Root of f2: (3.14159, 0)Details
- Roots are found where a graph changes sign between two neighbouring samples, then narrowed down by bisection to the last digit a double holds: x² − 2 has its roots at −1.41421 and 1.41421 (±√2). A graph that only touches the x axis, such as x², is found from its turning point. Intersections are the roots of the difference of two graphs, worked out for every pair: sin x and cos x meet at (−2.35619, −0.707107) and (0.785398, 0.707107) and (3.92699, −0.707107) between -4 and 4.
- Maxima and minima are found where the samples rise then fall (or the other way), then refined with the exact derivative of your function (the same engine as the derivative calculator) where it changes sign: x³ − 3x has a local max at (−1, 2) and a local min at (1, −2). In degrees, or when the derivative would be too large to work with, a golden-section search does it numerically instead.
- Asymptotes and gaps are drawn as they are. The graph takes two samples per pixel and splits an interval further where the curve bends or jumps; a jump across the whole graph that does not close as the interval shrinks is a break, so tan x and 1/x have no vertical joining lines. A sign change across a pole is not counted as a root either: tan x between -4 and 4 has roots at −3.14159, 0, 3.14159 and nothing at ±π/2. Where a function is undefined (√x and ln x left of 0, arcsin x outside -1 to 1) nothing is drawn, and the edge is found to a fraction of a pixel.
- A domain in braces after a function draws only that piece, so a piecewise function is one row per piece. The Piecewise example uses
y = -x {x < 0},y = sqrt(x) {0 <= x <= 4},y = 2 {x > 4}.x = 3draws a vertical line, and its crossings with the other graphs are listed as intersections. Anglesswitches the trig functions to degrees: sin(90) is then 1, and arcsin gives degrees.Gridturns the grid lines off andMark pointshides the markers. Grid steps are 1, 2 or 5 times a power of ten at any zoom; past 10⁶ or below 10⁻⁴ the labels are written as 2×10⁶.Copy linkputs the functions, their colours and the view in the part of the address after #, which your browser never sends to a server; opening the link draws the same graph. The functions you type are also kept in this browser for your next visit.
Limits
- It graphs y = f(x) and vertical lines x = c. Equations in x and y (x² + y² = 25), inequalities, polar and parametric curves, sliders for letters such as a and b, and 3D are not drawn; letters other than x must be replaced with numbers.
- Points are found between samples, two per pixel across. Two roots closer together than half a pixel show as one, or none if the graph dips and returns between samples: zoom in to separate them. Only the visible x range is searched, so pan or zoom out to find points further away.
- A table of values holds at most 1,048,575 rows, what one spreadsheet sheet takes; the page shows the first 100 with Show more, and the CSV has all of them at 12 significant digits.
- Zooming in stops when the view is narrower than about 10⁻¹¹ times its distance from 0: the numbers a browser computes with (doubles, about 16 digits) have no distinct values left to draw below that.
FAQ
How do I find where two graphs intersect?
Type both functions as rows. Every intersection in the visible part of the graph is listed under it as Intersection, with the two rows and its coordinates, and marked on the graph; there is nothing to press. Pan or zoom out to find ones further away.
How do I graph a piecewise function?
Type one row per piece with its domain in braces after it, such as -x {x < 0} and sqrt(x) {x >= 0}, and give the rows the same colour if you want them to look like one graph. {-1 <= x <= 2} sets both ends; < and > leave the end out.
Why does tan x have gaps?
tan x is undefined where cos x is 0 (x = π/2 + kπ), and it runs off to plus infinity on one side and minus infinity on the other. The calculator breaks the curve there instead of joining the two ends with a vertical line, which many graphing calculators draw by mistake.
Does the graphing calculator use degrees or radians?
Radians, unless you choose Degrees in Angles. In degrees sin(30) is 0.5 and arcsin(1) is 90; the Degrees example shows sin and cos over one full turn.
Can I save or share a graph?
Download above the graph saves it as PNG or SVG, as you see it. Copy link gives a link that opens the same functions, colours and view; the graph is held in the link itself, so nothing is stored on a server.
Runs entirely in your browser. Nothing is uploaded.