Math
Function Grapher – Plot y = f(x) with a Math Field
Plot y = f(x) over a chosen domain, with an optional second curve.
Free to use — no sign-up or login.
This free Function Grapher plots y = f(x) in the browser. Type an expression in x — in a math field that looks like homework, or in plaintext if you prefer ASCII — choose an x-range, and the curve is sampled and drawn on Cartesian axes. You do not need an account.
An optional second expression g(x) draws another curve on the same axes so you can compare shapes, crossings, or how fast one grows against the other. Hover for a crosshair reading. This is a 2D plot of y = f(x), not a computer-algebra system: it will not solve for x, shade inequalities, or keep a list of ten functions.
How to type an expression
The default editor is a math field: fractions, exponents, and square roots look the way they do on paper. If you would rather type ASCII, turn on Plaintext and use a monospace box — sin(x), x^2, sqrt(x). A compact keypad sits under the active field and inserts sin, cos, tan, ln, log, sqrt, abs, π, e, ^, parentheses, /, and x into whichever editor you are using. The graph redraws as you type (about a tenth of a second after the last keystroke); Enter redraws at once. In plaintext, a live preview renders the same expression as mathematics so the box still feels scientific. For a numeric result instead of a curve, use the Scientific Calculator.
Implicit multiplication and common functions
The plotter needs an explicit operator between factors. Typing 2x or 2π is fine: the page inserts * before it draws, and it turns a closing parenthesis against an opening one into )*(. Write x^2 for a square, sqrt(x) for a root, abs(x) for absolute value, and sin(x), cos(x), or tan(x) for the usual trigonometric functions. π or pi becomes PI, which is the constant this library expects. ln is natural log (log in the plotter); the log key is log base 10. If a token is wrong, the error names the leftover piece instead of a generic “check the syntax” line.
Choosing an x-range
x-min and x-max are the domain the sampler walks. Presets cover [−10, 10], [−π, π], [0, 2π], and [−5, 5]. A sine or cosine on [−10, 10] looks like a crowded scribble; [−π, π] shows one full period of sin(x) with the familiar zeros at −π, 0, and π. [0, 2π] is the other conventional window for a full turn. Leave y-min and y-max empty to let the plot autoscale; fill both when a steep line or a tall parabola flattens everything else. Pan and zoom on the figure, then Reset view to return to the numbers in the form. For cosine and sine at one angle rather than a sweep, use the Unit Circle Calculator.
Comparing f(x) and g(x) on one set of axes
f(x) draws in teal and g(x) in coral, with a legend under the figure. Put a parabola in f and a line in g — x^2 against 2x — and you can see where they meet without switching pages. The same domain applies to both curves, which is what you want when you are asking which grows faster or whether they cross in the window. To solve ax² + bx + c = 0 for those crossings as numbers, use the Quadratic Equation Calculator. A line through two points is the Slope Calculator or the Linear Equation Calculator.
What the graph will not do
The curve is a polyline through sampled points, not a computer-algebra graph. A hole — a point you would cancel in a fraction — will not appear as a hollow dot. A vertical asymptote such as x = 0 on 1/x shows up as a steep jump where samples skip from a large positive y to a large negative y; the library may draw a near-vertical segment across that gap. This page is not Desmos: there are no sliders, no tables, no inequality shading, no polar or 3D mode, and no CAS that simplifies or differentiates the expression as an object. Two expressions is the limit. If the syntax is wrong, you get an error pointing at the bad token, not a guessed plot.
Classroom and homework use
Use this when you want to see the shape of a homework function, compare two models, or check that a transformed sine still has the period you think it does. Project the widget so a class can watch the domain presets change the picture. It is not a graphing-calculator exam device: many sittings ban phones and browsers, and this page does not pretend to be TI, Casio, or a locked-down testing app. Practice the shapes here; sit the exam on whatever tool the instructor named.
Worked example: sin(x) on [−π, π] and x² versus 2x
Leave f(x) as sin(x) and tap the [−π, π] preset. You get one full period: the curve is 0 at −π, rises to 1 at −π/2, returns through the origin, falls to −1 at π/2, and is 0 again at π. That window is easier to read than [−10, 10], which packs several periods into the same width. For a second picture, set f(x) to x^2 and g(x) to 2x, still on a modest domain such as [−5, 5]. The teal parabola sits on the origin; the coral line climbs through it. They meet where x^2 = 2x, so x = 0 and x = 2 — you can see both crossings on the axes, then confirm the numbers with the Quadratic Equation Calculator if you want the algebra written out.
Frequently asked questions
How do I type 2x, x^2, or sin(x)?
In the math field, type as you would on paper, or tap the keypad for sin, sqrt, π, and ^. In plaintext, write sin(x), x^2, and 2x or 2*x — the page inserts * for implicit multiplication before it plots. π or pi becomes PI. Press Enter to redraw at once.
How do I add a second curve?
Type an optional g(x). It draws in coral on the same axes and domain as f(x). Leave g(x) blank if you only want one curve. The legend under the figure names both expressions once they plot.
Which x-range should I pick?
Use [−10, 10] as a first look at polynomials. For sine and cosine, [−π, π] or [0, 2π] shows a full period without crowding. Fill y-min and y-max when autoscale flattens a steep graph. Reset view restores the form domain after pan or zoom.
Why does 1/x look broken at zero?
The grapher samples points and connects them. It does not punch a hole or draw a clean vertical asymptote. Near x = 0, 1/x jumps from large positive to large negative values, so you may see a steep segment across the y-axis. That is a sampling artifact, not a finite value at 0.
Is this the same as Desmos?
No. Desmos is a full graphing calculator with sliders, tables, regressions, and CAS-style tools. This page plots y = f(x) and optional g(x) with function-plot. The math field and keypad make typing nicer; they do not turn this into Desmos.
Does the math field work on a phone?
Yes. The math field and the plaintext box are both usable on a phone; the keypad under the active field is there so you do not have to hunt for π or a square root on a small keyboard. Landscape helps if you want a wider plot. This is still a browser page, not an exam-approved calculator.