Curve Fit Calculator

This curve fit calculator tries linear, quadratic, cubic, exponential, power and logarithmic curves on your x and y data and ranks them by R².

Checks on your data

  • The highest R² is not always the best model. Higher-degree polynomials fit noise, so prefer a simple curve that matches how the data are generated.

Results

Highest R²: Exponential
y = 1.8823·e^(0.51251x)
R² of that model
0.999745
Models compared
6
Runner-up
Cubic (R² = 0.99948)
Prediction at x = 9
189.622
Data with the exponential curve
0501002468xy
R² by model
00.5Exponential: 0.999745Exponential1Cubic: 0.999478Cubic0.999Quadratic: 0.98535Quadratic0.985Linear: 0.818912Linear0.819Power: 0.789464Power0.789Logarithmic: 0.590553Logarithmic0.591
All models ranked by R²
ModelEquationR²Adjusted R²RMSE
Exponentialy = 1.8823·e^(0.51251x)0.999740.999640.5693
Cubicy = -5.4 + 10.839x − 3.4643x^2 + 0.49167x^30.999480.998780.81436
Quadraticy = 18.938 − 14.482x + 3.1732x^20.985350.974364.3142
Lineary = -28.661 + 14.077x0.818910.7464815.168
Powery = 1.946·x^1.71470.789460.7052516.355
Logarithmicy = -20.497 + 41.63·ln x0.590550.4267722.808
Show step-by-step solution
  1. Fit each model to the 8 points by least squares.
  2. Exponential, power and logarithmic models are fitted by taking logarithms and fitting a straight line.
  3. Rank by R². Exponential is highest with R² = 0.999745.
  4. R² always rises with more parameters, so also compare adjusted R² and look at the plot.
ModelsLinear, quadratic, cubic, exp, power, log
Ranked byR²
ExtraPrediction at x
Needs5+ points

What Is Curve Fit?

Curve fitting finds a function that follows the pattern in your data. Because the best model is rarely obvious, this tool fits several curves at once and shows them in one ranked table.

Enter your points to see the highest-R² curve with its equation, the adjusted R² and RMSE of every model, and a prediction for any x you choose. A chart of the data and curve and a bar chart of R² by model help you judge the fit.

The sections below explain R², why a higher degree can overfit and how to choose a sensible model.

How to Use the Curve Fit Calculator

  1. Enter x and y values in matching order.
  2. Optionally enter an x to predict.
  3. Read the ranked model table.
  4. Check the curve against the points.

Curve Fit Formula

R²

R2=1−SSresSStotR^2=1-\frac{SS_{res}}{SS_{tot}}

Adjusted R²

Radj2=1−(1−R2)(n−1)n−k−1R^2_{adj}=1-\frac{(1-R^2)(n-1)}{n-k-1}

Curve Fit Variables Explained

SymbolMeaningNotes
x, yYour data points
R²Share of variation explained
Adjusted R²R² corrected for the number of parameters
RMSETypical size of the residuals

Curve Fit Worked Example

Values that roughly multiply by 1.65 at each step, such as 3.1, 5.2, 8.9, 14.8, 24.5, are growing exponentially. The exponential model ranks first with R² close to 1, while a straight line fits poorly.

With the example values loaded in the calculator above, the steps are:

  1. Fit each model to the 8 points by least squares.
  2. Exponential, power and logarithmic models are fitted by taking logarithms and fitting a straight line.
  3. Rank by R². Exponential is highest with R² = 0.999745.
  4. R² always rises with more parameters, so also compare adjusted R² and look at the plot.

Result: Highest R²: Exponential = y = 1.8823·e^(0.51251x); R² of that model = 0.999745; Prediction at x = 9 = 189.622.

Where Curve Fit Is Used

Lab data

Find the relationship between two measurements.

Growth trends

Test for exponential growth.

Forecasting

Predict a value at a new x.

Model comparison

See which curve family suits the data.

Common Curve Fit Mistakes to Avoid

  • Look at the scatter plot first.
  • Do not extrapolate far beyond the data.
  • Exponential and power fits need positive y.

Curve Fit Terms and Definitions

Residual
The difference between an observed y and the curve’s y.

Curve Fit FAQs

How do I fit a curve to data points?

Choose a model, then find the parameters that minimise the squared distance to the points, which is what this tool does for several models at once.

Which curve is the best fit?

The one with a high R² that is also simple and sensible for the process behind the data.

Why does R² rise with a higher degree?

More parameters can always follow the points more closely, so use adjusted R².

Can I predict with the curve?

Yes, enter an x. Predictions inside the data range are safer than those outside it.

Related calculators

Last updated 2026-11-09. See our disclaimer.