Curve Fitting Calculator

Fit a curve to your data online. Paste X/Y points and run linear, polynomial, exponential, logarithmic, power, logistic, Gaussian, or custom regression — with coefficients, R-squared, RMSE, and an interactive chart. Runs entirely in your browser.

One point per line — x and y separated by comma, tab, or space.7 points

Fit Results

Enter at least two data points to see the fitted curve.

Why use a curve fitting calculator?

Curve fitting finds the equation that best describes the relationship between two variables. Instead of guessing a trendline by eye, this tool solves for the coefficients that minimize the error between your data and a chosen model — linear, polynomial, exponential, logarithmic, power, logistic, Gaussian, or any custom equation you type. You get the fitted equation, the R-squared and RMSE that tell you how well it fits, and a chart that overlays the curve on your points. Everything runs locally in your browser, so your data never leaves your device.

Curve fitting (also called regression) is the process of finding a mathematical function that closely matches a set of observed data points. It is used everywhere from science labs estimating reaction rates, to analysts modelling growth, to engineers calibrating sensors. This calculator supports the models people reach for most often: a straight line for proportional trends, polynomials for gentle curves, exponential and power laws for growth and decay, logarithmic curves for diminishing returns, the logistic S-curve for saturating growth, and the Gaussian bell curve for peaks and distributions.

For linear, polynomial, and logarithmic models the fit is solved exactly using least squares, so the result is deterministic and instant. For the nonlinear models the tool runs a Levenberg-Marquardt optimizer with a sensible starting guess, the same battle-tested algorithm used by scientific software. The reported R-squared value ranges from 0 to 1 — the closer to 1, the better the curve explains the variation in your data — while RMSE reports the typical error in the original units.

Need related math tools? Try the Scientific Calculator for one-off evaluations, the Percentage Calculator for quick ratios, or the 3D Function Plotter to visualize multivariable functions. You can export your fitted coefficients as JSON or download per-point predictions and residuals as CSV for further analysis.

Frequently Asked Questions

1

What is curve fitting?

Curve fitting finds the equation that best matches a set of X/Y data points. The calculator solves for the coefficients of your chosen model so the curve passes as close as possible to every point.
2

What does R-squared mean?

R-squared (the coefficient of determination) measures how well the fitted curve explains the variation in your data. It ranges from 0 to 1 — a value near 1 means the model fits closely, while a low value means the model is a poor match.
3

Which model should I choose?

Pick the shape that matches your data: a line for steady trends, a polynomial for smooth curves, exponential or power for growth and decay, logarithmic for diminishing returns, logistic for an S-shaped saturation, and Gaussian for a single peak. If none fit, enter a custom equation.
4

Can I fit my own equation?

Yes. Choose 'Custom equation' and type any expression using x and single-letter parameters such as a, b, and c — for example a*sin(b*x) + c. The optimizer will solve for the parameter values that best fit your data.
5

Is my data uploaded anywhere?

No. All calculations happen entirely in your browser. Your data points are never sent to a server.

Rate This Tool

0/1000

Get Weekly Tools

Suggest a Tool