Skip to content

Curve Fitting Calculator

Fit a line, polynomial, exponential, logarithmic or power curve to your data and get the equation and R²

Loading the tool…

Fits a trendline to x and y data by least squares and gives the equation, R², adjusted R², standard error and residuals, with predictions from the fitted curve.

How to use

  1. Paste two columns into "x and y data", x on the left; a header row is recognised.
  2. Choose a "Model"; the equation, R² and chart update at once.
  3. For exponential and power curves, pick the "Fitting method": "Log transform (as Excel trendlines)" or "Nonlinear least squares".
  4. Use "Predict y at x" or "Find x for y", and "Copy equation" or "Copy Excel formula" to reuse the result.
  5. Compare every model in "All models compared".

How it works

Questions and answers

Why is my R² different from the Excel trendline?
For exponential and power trendlines Excel reports R² of ln y. The page shows it as "R² of ln y" next to R² measured on y.
Which model should I choose?
The simplest one whose residuals scatter randomly around 0. Higher polynomial degrees always raise R², so compare adjusted R² or AIC.
Can I fit an exponential curve when some y values are zero?
No. The log transform needs every y greater than 0. Use a polynomial instead.
What is the standard error of the regression?
The typical size of a residual, √(SSE ÷ (n − number of coefficients)), in the unit of y.