Percentages and Math

Curve Fit Calculator

Paste your x and y pairs to see which curve follows them best and what it predicts.

Your numbers

Write x then y, separated by a comma, space or tab. Example data.

A value inside or near the range of your data gives the most reliable prediction.

Result

Exponential fit (best R squared)

y = 1.9795 e^(0.375076 x)

R squared 0.9999 on your y values.

Model
Exponential
Equation
y = 1.9795 e^(0.375076 x)
R squared (original y)
0.9999
R squared (transformed scale)
0.9998
Adjusted R squared
0.9999
Standard error of the fit
0.13212
Pairs used
8

All models compared on your y values

ModelFormR squaredAdjustedStd. error
Lineary = a + b x0.88670.86784.674
Quadraticy = a + b x + c x^20.99460.99241.122
Exponentialy = a e^(b x)0.99990.99990.1321
Logarithmicy = a + b ln x0.67410.61977.929
Powery = a x^b0.84410.81825.483

Fitted values and residuals

xyFitted yResidual
12.92.880380.01962
24.14.19125-0.09125
36.26.098690.1013
48.88.87422-0.07422
513.112.91290.1871
618.718.7896-0.08958
727.427.34080.05924
839.639.7836-0.1836
How this was calculated
  1. Exponential: ln y is fitted as a straight line in x, then converted back. That fit minimizes errors on the transformed scale, not on y itself.
  2. Sum of squared residuals on y = 0.104733; total variation of y = 1157.24; R squared = 1 - 0.104733 / 1157.24 = 0.9999.
  3. Residuals of a straight line or quadratic fit add up to zero and are uncorrelated with x, which is a quick check that the numbers are right.
  • A higher R squared means the curve follows these points closely, not that the model is the right explanation. Compare the shape of the residuals too: a pattern in them means the model misses something.

Calculated using SumPanda.com · https://sumpanda.com/curve-fit-calculator/

Results are estimates for general information. Verify important figures before relying on them.

Next step

How to use the curve fit calculator

  1. Paste your x and y pairs, one pair per line, with a comma, space or tab between the numbers. At least three pairs are needed.
  2. Leave Model to show on "Best fit by R squared", or choose one of the five curves. The comparison table always lists every model that can be fitted to your data.
  3. Enter an x value under Predict y at x to see what the chosen curve gives there. A prediction inside the range of your data is far more reliable than one outside it.
  4. Look at the residuals table. If the leftovers show a pattern, such as all positive in the middle and negative at the ends, the curve misses something.

Formula

Linear: y = a + b x Quadratic: y = a + b x + c x^2

Exponential: y = a e^(b x), fitted as ln y = ln a + b x

Logarithmic: y = a + b ln x Power: y = a x^b, fitted as ln y = ln a + b ln x

R squared = 1 - (sum of squared residuals) / (total variation of y)

Linear and quadratic fits solve the least squares equations directly. The other three are straight lines after a transformation, so they are fitted on the transformed scale and converted back. R squared is always measured on your original y values, so the five models can be compared fairly.

Eight points that grow fast

Take x = 1 to 8 and y = 2.9, 4.1, 6.2, 8.8, 13.1, 18.7, 27.4 and 39.6. The R squared values on y are 0.8867 for the line, 0.9946 for the quadratic, 0.9999 for the exponential, 0.6741 for the logarithmic curve and 0.8441 for the power curve.

The best fit is y = 1.9795 e^(0.375076 x), which grows about 45.5% for each step in x. At x = 10 it predicts 84.2347, while the quadratic y = 5.78571 - 2.81429 x + 0.861905 x^2 predicts 63.8333. Both fit the data well, and they disagree outside it, which shows why predictions beyond your data deserve caution.

Choosing between models

A higher R squared means the curve follows these points more closely, but a flexible curve can always follow points more closely. The adjusted R squared and the standard error in the table take the number of coefficients into account, so they are fairer when you compare a quadratic with a two-coefficient model.

Think about the process too. Growth that multiplies by a similar factor each step suggests an exponential, a quantity that changes by a fixed amount suggests a line, and a relation that follows a power of size, such as area against length, suggests a power curve. The fit cannot decide that for you.

When a model cannot be fitted

Exponential and power curves need every y to be above 0, because they use ln y. Logarithmic and power curves need every x above 0. The quadratic needs three different x values. A model that cannot be fitted is marked "not fitted" in the comparison table instead of giving a wrong number. For a straight line only, the Linear Regression Calculator gives more detail about the slope and the correlation.

More statistics tools

For reliability, risk and distribution questions, try the Odds Ratio and Relative Risk Calculator, Grouped Data Statistics Calculator and Skewness and Kurtosis Calculator.

Assumptions and limits

  • Each pair is a separate observation, and x is known much more precisely than y.
  • The spread of y around the curve is roughly the same everywhere. Fitting ln y gives more weight to small y values than a fit on y itself would.
  • No weighting of points and no removal of outliers is applied.
  • Predictions use the fitted curve as written, with no interval around them.

Formulas reviewed October 10, 2026. See the calculation methodology for how SumPanda rounds, tests and sources its formulas.

Frequently asked questions

Why can R squared be lower than the value I get in a spreadsheet for an exponential trendline?

Many spreadsheets report R squared on the logarithm of y. This page reports it on the original y values and also shows the transformed value, so you can match either convention.

What does the standard error of the fit mean?

It is the usual size of a residual, in the units of y, after allowing for the number of coefficients: the square root of the sum of squared residuals divided by the points minus the coefficients.

Can I fit a curve through just three points?

The page allows it, but a quadratic through three points passes through every one of them, so R squared is 1 and tells you nothing. A warning appears when there are no more points than coefficients.

How do I read a negative residual?

A negative residual means the point lies below the curve, so the curve predicted more than the measured value. Residuals of a straight line or quadratic fit always add up to zero.