Calcist

Style

Buttons

Spacing

How much to show

Decimal places

Text size

Exponential regression calculator

Paste x, y data to fit an exponential regression equation, or a linear, power or logarithmic one. You get the equation, r and R², every residual, a comparison of all four models, and a plot.

Private: calculated on your device. Nothing you type is sent anywhere.

Next: Want the summary statistics of your data first? Use the statistics calculator. Working with growth rates? The log calculator explains ln.

What regression does

Regression finds the curve of a chosen shape that best fits your data points. An exponential model fits things that grow or shrink by a steady percentage: bacteria, compound interest, cooling, radioactive decay, viral spread. Linear fits steady amounts of change, power fits area and volume scaling, and logarithmic fits growth that keeps slowing down.

How it's calculated

Linear regression is ordinary least squares. It picks the line that makes the sum of squared vertical distances to the points as small as possible:

b = Σ(x − x̄)(y − ȳ) ÷ Σ(x − x̄)²    a = ȳ − b·x̄
r = Σ(x − x̄)(y − ȳ) ÷ √[Σ(x − x̄)² · Σ(y − ȳ)²],   R² = r²

The curved models are made straight by taking logs, fitted as a line, then transformed back:

ModelStraight line fittedThen
Exponential, y = a·e^(bx)ln y against xa = e^(intercept), b = slope. Also y = a·Bˣ with B = e^b
Power, y = a·x^bln y against ln xa = e^(intercept), b = slope
Logarithmic, y = a + b·ln xy against ln xa = intercept, b = slope

Important: the exponential and power fits are transformed fits. They minimize squared errors in ln y, not in y. This is the standard log-transform method, but a direct nonlinear least-squares fit can give slightly different a and b, and gives more weight to large y values. So the page reports two R² values: the R² of the straight-line fit to ln y, and an R² measured on y itself, 1 − Σ(y − ŷ)² ÷ Σ(y − ȳ)².

Worked example

The default data (x = 0 to 5, y = 2.0, 3.1, 4.4, 6.9, 10.2, 15.1) looks like steady percentage growth. Fitting a line to (x, ln y) gives slope 0.403732 and intercept 0.70313, so

y ≈ 2.0201·e^(0.4037x) = 2.0201·1.4974ˣ

Each step of 1 in x multiplies y by about 1.497, so y doubles every ln 2 ÷ 0.4037 ≈ 1.717 units of x. The correlation of ln y with x is r ≈ 0.99967, so R² ≈ 0.99933.

Limitations

  • Exponential fits need every y above 0, power fits need every x and y above 0, and logarithmic fits need every x above 0, because logs of 0 or negatives don't exist. The calculator names the first point that breaks the rule.
  • A high R² doesn't prove the model is right. Look at the residuals. If they curve in a pattern instead of scattering randomly, try another model.
  • Predicting far outside your x range (extrapolation) is risky, especially with exponential models, which grow without limit.
  • One outlier can pull a least-squares fit a long way. Check the residual table for any point that sits far from the rest.

Sources

How we checked this

Before every update, this calculator is run in a real browser with these known answers, and it must match all of them:

  • Exponential fit of the sample data: y = 2.02007·e^(0.403732x) ✓
  • R² of the ln y fit ≈ 0.9993318957 ✓
  • R² measured on y ≈ 0.9995917625 ✓
  • Prediction at x = 6 ≈ 22.77175084 ✓
  • Linear fit: y = 2.55143x + 0.571429, r ≈ 0.9631118638 ✓
  • Power fit: a ≈ 2.068073709, b ≈ 1.974855641 ✓
  • Log fit: y = 1.02 + 1.4427·ln(x) ✓
  • Exponential fit refuses y ≤ 0 ✓
  • One point isn't enough ✓
  • Identical x values can't be fitted ✓

Last checked October 26, 2026. Spotted something wrong? The math is done in your browser with the formula shown on this page, so you can check any result by hand.

Add this calculator to your website (free)

Paste this code into any web page. The calculator works on your page, resizes itself, has no ads and no tracking, and nothing your visitors type is sent anywhere. More about embedding.

Questions people ask

How do you find an exponential regression equation?

Take the natural log of every y, fit a straight line to (x, ln y), then set b = the slope and a = e^(intercept). The equation is y = a·e^(bx). This calculator does those steps for you.

What's the difference between y = a·e^(bx) and y = a·b^x?

They're the same curve written two ways. The growth factor per unit of x is B = e^b in the first form, so y = a·Bˣ.

What does R² mean?

The share of the variation in y (or in ln y, for a transformed fit) that the model explains. R² = 0.95 means 95% is explained and 5% is left in the residuals.

Why might another tool give slightly different numbers?

Some software fits the curve directly by nonlinear least squares instead of fitting a line to ln y. Both are valid but minimize different errors, so a and b can differ a little. Check which method a tool uses before comparing.

Can I fit data with zeros or negative y values exponentially?

Not with this method, because ln y needs y > 0. Shift the data, use a linear model, or use nonlinear fitting software.

Related calculators