liminfo

Graphing Calculator

Free web tool: Graphing Calculator

Graph Calculator

Plot mathematical functions. Use x as variable. Supports Math.sin, Math.cos, Math.sqrt, **, etc.

About Graphing Calculator

The Graph Calculator is a free, browser-based mathematical function plotter that renders equation curves instantly using HTML5 Canvas. You can enter any expression in terms of x — including trigonometric functions (sin, cos, tan), logarithms (log for base-10, ln for natural log), square roots (sqrt), absolute values (abs), and polynomial expressions using the exponent operator (^). The x-axis range is fully customizable so you can zoom in or pan to any region of interest.

This tool is designed for students learning calculus or precalculus, educators preparing lesson visuals, engineers performing quick function analysis, and hobbyists exploring mathematical curves. The calculator evaluates the function at every pixel column across the canvas, automatically scales the y-axis to fit the output, and draws grid lines with labeled axes for easy reading. Preset buttons for common functions like sin(x), cos(x), x², x³-3x, √x, and 1/x let you get started instantly.

All rendering happens entirely within your web browser using the Canvas 2D API and a sandboxed Function constructor — no data is ever sent to a server. The plotter detects discontinuities (such as in 1/x) by breaking the path at undefined or non-finite values, ensuring clean curve rendering. Dark mode is fully supported, adapting background, grid, and axis colors automatically when your system theme changes.

Key Features

  • Plot any mathematical expression in x using standard operators (+, -, *, /, ^) and function notation
  • Built-in support for sin, cos, tan, log (base 10), ln (natural log), sqrt, and abs
  • Adjustable x-axis range (X Min / X Max) for zooming into any region
  • Automatic y-axis scaling that fits the full range of computed output values
  • Grid lines and axis labels rendered on the canvas for easy value reading
  • Six one-click preset functions: sin(x), cos(x), x², x³-3x, √x, 1/x
  • Discontinuity-safe path rendering — breaks the curve at undefined or infinite values
  • Full dark mode support with adaptive canvas background and grid colors

Frequently Asked Questions

What syntax do I use to enter a function?

Use standard JavaScript-style math expressions with x as the variable. For example: sin(x), x^2, x**3-3*x, sqrt(x), 1/x, or log(x). You can also combine them like sin(x)*cos(x) or x^2+sqrt(abs(x)).

How do I plot a trigonometric function like sine or cosine?

Simply type sin(x) or cos(x) into the f(x) field, or click the preset buttons labeled sin(x) or cos(x). The tool automatically converts these to the corresponding JavaScript Math methods.

What is the difference between log and ln in this calculator?

In this calculator, log computes the base-10 logarithm (common log), while ln computes the natural logarithm (base e). This matches conventional mathematical notation used in most textbooks.

Can I change the range of the x-axis?

Yes. Use the X Min and X Max input fields to set the horizontal range. The y-axis is automatically scaled to match the computed values within that range, so you do not need to set it manually.

Why does my function graph show a gap or break?

Gaps appear at points where the function is undefined or returns an infinite value, such as x=0 for 1/x or negative x for sqrt(x). The calculator intentionally breaks the path at these points to avoid misleading lines across discontinuities.

Does the graph calculator support polynomial expressions?

Yes. You can enter any polynomial using the standard exponent operator. For instance, x^3 - 3*x + 2 or 2*x^4 - x^2 + 5. The ^ operator is automatically converted to the ** power operator internally.

Is the calculation done securely in the browser?

Yes. The expression is evaluated using a sandboxed Function constructor that only has access to x and JavaScript's built-in Math object. No arbitrary code execution outside of math operations is possible, and no data leaves your browser.

Can I use this graph calculator on a mobile device?

Yes. The canvas scales to the full width of its container using CSS, so the graph displays correctly on smartphone and tablet screens. The input fields and preset buttons are also touch-friendly.