Math calculator

Exponential Regression Calculator

Fits the curve, and the curve everyone else fits, so you can see them disagree.

Two exponential fits, side by side

y must be positive for every row: the fit takes its logarithm.

The headline case: the two fits disagree about the doubling time by 8%.

Least squares on the data: y = 97.1302·e^(0.692513x)

Doubles every 1.0009 in x

The linearised fit — what every other calculator reports — says 0.9225, a 7.83% difference.

Initial value a

97.1302

linearised: 57.1955

Rate b

0.692513

linearised: 0.751352

Doubling time

1.0009

linearised: 0.9225

Growth per unit x

99.873%

compounded continuously

R² (least squares)

0.998792

on the data's own scale

R² (linearised, on data)

0.994214

the same curve, measured honestly

R² (log space)

0.999806

what competitors print

Points dropped

0

none

050000100000510xy

Solid: the curve that minimises squared error on the data. Dashed: the curve every other calculator returns, from least squares on the logarithms.

At x = 12.0000 the two curves predict 394,829.842 and 471,042.233. The first is the least-squares fit, the second the linearised one. Extrapolation magnifies the disagreement between them, because the rates differ and the gap compounds — which is exactly the region people fit an exponential in order to use.
The linearised fit leaves 4.7877× the squared error: 53,500,336.6116 against 11,174,497.0677. Taking logs first changes what is being minimised. Least squares in log space minimises Σ(ln y − ln ŷ)², which weights a 10% miss on a value of 5 exactly as heavily as a 10% miss on a value of 50,000. That is sometimes the right choice — but it is a choice, and it is never the fit that minimises error in the units the data is measured in.
The R² a spreadsheet shows for this data is 0.999806. That figure belongs to the straight line through the logarithms, not to the curve through your points. The same curve scores 0.994214 against the actual y values, and the least-squares curve scores 0.998792. All three are correct answers to three different questions, and only one of them is the one a reader assumes they are being told.

What this tool shows

The standard method does not minimise error in your units. It takes logarithms first, which is a different objective. On the preset here that costs 4.79× the squared error and puts the doubling time at 0.92 rather than 1.00 — and the doubling time is the number people actually quote.

  • y = ae^(bx) by Levenberg-Marquardt on the untransformed residuals
  • The usual log-linear fit alongside it, with both equations
  • Doubling time or half-life from each, and the gap between them
  • Three R² values: log space, that curve on your data, and the real one
  • Continuous growth rate converted to a percentage per unit x
  • Prediction at any x from both curves, so the divergence is visible
True least squares And the linearised fit Doubling time from each Three R² values

4.79× the squared error, and an 8% error in the doubling time.

Updated 12 September 2026 · Works in any browser, no installation

Exponential regression fits y = aebx, where b is a constant proportional growth rate. The closed-form method takes logarithms of y, runs ordinary least squares, and transforms back — which is fast, universal, and not the same thing as fitting the curve to the data.

At a glance

Formula shown
Taking logs gives ln y = ln a + bx, a straight line, so b and ln a come from ordinary least squares and a = e^(ln a). That minimises Σ(ln y − ln ŷ)². Minimising Σ(y − ŷ)² instead has no closed form and needs iteration — Levenberg-Marquardt, seeded from the log-linear estimate. Doubling time is ln2/b; for negative b the same expression gives the half-life.
Scenario support
Growth that compounds: user signups, cell cultures, epidemics before saturation, compound returns, viral spread. Decay that compounds: radioactive isotopes, drug clearance, Newton cooling, churn from a fixed base. Anywhere the sensible question is "how long to double" rather than "how much per step".
Educational estimate
Planning support from the values you enter — not professional advice.

The standard method fits a different curve

Open any other exponential regression calculator, feed it data, and it will hand back a curve. It found that curve by taking the logarithm of every y value and running a straight-line regression.

That works because the algebra is exact. ln y = ln a + bx is genuinely linear, so the slope and intercept come from a formula rather than from a search. It is why every spreadsheet, graphing calculator and website does it this way.

But least squares is defined by what it minimises, and the transform changes that. Minimising Σ(ln y − ln ŷ)² is not minimising Σ(y − ŷ)². They are different problems with different answers, and the second one — the one that actually fits the curve to the data — has no closed form at all.

So this tool solves it numerically. Levenberg-Marquardt runs on the untransformed residuals, seeded from the log-linear estimate so it starts close. Both curves are drawn, both equations are printed, and both sums of squared error are shown.

On the signups preset the linearised curve leaves 4.79 times the squared error. 53,500,337 against 11,174,497. That is not a rounding artefact or a convergence tolerance; it is two genuinely different curves through the same ten points.

The gap is not always large. The compound-growth preset spans a narrow range with little noise, and there the two fits agree to within 1%. The verification suite checks the inequality as a universal property over 600 random datasets — least squares never loses — and separately checks that it strictly wins on the overwhelming majority.

The doubling time inherits the error

Almost nobody quotes b. They quote the doubling time, because ln2/b is a number a person can hold: this doubles every month, that halves every six hours.

Which means the doubling time carries whatever error the fit had, and it carries it reciprocally — a small overstatement of the rate becomes a proportional understatement of the time.

On the signups preset that is 0.92 months against 1.00. The linearised rate is 0.751352 and the least-squares rate is 0.692513. Stated as doubling times the difference is roughly 8%, and stated as a forecast a year out it is a factor of more than two.

The direction is predictable, if not guaranteed. Log space weights proportional error equally at every magnitude, so the small early values pull the line as hard as the large late ones. When the early values sit above the trend the linearised rate comes out too low; when they sit below it, too high. The tool prints both rates rather than asking you to reason about which case you are in.

Negative rates get a half-life instead, from the same expression: ln2/b is negative, and its magnitude is the time to fall by half. The cooling preset exercises this path, and the labelling changes with the sign rather than showing a negative doubling time.

Neither figure is a forecast. A doubling time describes the period the data covers. It becomes a prediction only under the assumption that the proportional rate is constant, which is the one thing exponential growth in the real world reliably stops doing.

Three R² values, and the one you are shown

A spreadsheet reports one R² for an exponential trendline. There are three defensible numbers here and they can differ in the second decimal place.

The log-space R² measures the straight line through the logarithms. On the signups preset that is 0.999806, and it is the figure every other tool displays. It is a true statement about a regression on transformed data.

The same curve, measured against the actual y values, scores 0.994214. Identical curve, identical data, different question — and this is the number that answers “how well does this curve describe my data”.

The least-squares curve scores 0.998792. Higher than the linearised curve on the data, as it must be, and lower than the log-space figure, which was never measuring the same thing.

The difference is not cosmetic when it crosses a threshold. A reported 0.9998 and a real 0.9942 support different claims about how much of the variation a model captures, and the shortfall lands entirely on the largest values — which are usually the ones the model was built to forecast.

This is a general property of back-transformed fits, not a quirk of exponentials. The power regression page has exactly the same gap for exactly the same reason, and the R² calculator shows all five models side by side. The one transform that escapes it is logarithmic regression, because it transforms only x.

A zero in y is fatal, and most tools hide it

ln 0 is negative infinity and ln of a negative number is undefined. An exponential curve can approach zero but never reaches it, so a zero observation is not merely awkward for the arithmetic — it is outside the model.

Most implementations drop those rows and say nothing. You get a fit, it looks reasonable, and the count of points it was built from is smaller than the count you supplied.

This tool reports the number dropped as its own output. If it is not zero, the R² and the rate describe a subset of your data, and you should know which subset before quoting either.

Zeros are common in exactly the data people fit exponentials to. Case counts before an outbreak begins, signups in the first week, sales of a product not yet launched. Those rows are usually real information about when the process started, and discarding them silently discards it.

The usual workarounds are worse than they look. Adding a small constant to every y changes the fitted rate by an amount that depends entirely on the constant you picked, and there is no principled way to pick it. Starting the series at the first non-zero observation is at least explicit.

When zeros are genuine counts, Poisson regression is the honest model. It fits the same exponential mean, handles zero observations natively, and does not require a transform that the data cannot survive. That is a different tool from this one, and worth reaching for rather than working around.

When the linearised fit is the right answer

The point of showing both is not that one is always correct. It is that the choice is currently being made for you, silently, by whichever tool you opened.

Log space is right when the error is proportional. If your measurements are accurate to within roughly 5% whether the value is 10 or 10,000 — which is typical of counts, concentrations and anything measured by dilution — then equal weight per proportional error is exactly the correct weighting, and the linearised fit is the better estimator.

Original-scale least squares is right when the error is absolute. If a reading is accurate to within about two units regardless of size, the large values genuinely do carry more information about the curve, and weighting them more is correct.

A residual plot tells you which you have. Spreading residuals as y grows means proportional error and argues for the log fit; a constant band means absolute error and argues against it. The residual calculator shows that pattern directly.

Statistically, the two correspond to different noise models. The linearised fit is maximum likelihood under multiplicative lognormal error; the untransformed fit is maximum likelihood under additive normal error. Both are respectable. Neither is a default.

What is not defensible is reporting a log-space R² as though it described the data. Choose the objective deliberately and say which one you chose — that is the whole ask, and it is why this page prints both rather than picking for you.

Nothing stays exponential, and the fit cannot tell you when it stopped

An exponential model asserts a constant proportional rate forever. No real process does that, and the failure is always in the same direction: growth saturates, decay hits a floor.

A high R² says nothing about whether the period is over. The fit describes the range you gave it. Fitting the early part of a logistic curve produces a superb exponential fit and a forecast that is wrong by an unbounded amount.

The tool’s prediction box shows the two curves diverging. Inside the data they nearly coincide; a few units past it they do not, because the rates differ and the difference compounds. The gap between two reasonable fits is a lower bound on the uncertainty, never an upper one.

Look for curvature in the log plot. Genuine exponential data is straight when ln y is plotted against x. Bending downward is saturation beginning, and it is visible well before a summary statistic reacts to it.

If it bends, fit something that bends. A logarithmic fit for diminishing returns, a quadratic for a rise and fall, or a logistic model for a genuine ceiling. Comparing all five families at once is what the R² calculator is for.

And be wary of extrapolating a doubling time far past the data. Ten doubling periods is a factor of 1,024. A model built on four periods of observation has no evidence about the tenth, whichever of the two fits produced it.

Sources and methodology

References for the fitting method and for the transform it replaces.

Method. The linearised fit is ordinary least squares on ln y against x, exactly as every other tool computes it, so the two can be compared like for like. The least-squares fit is Levenberg-Marquardt on the untransformed residuals, seeded from the linearised estimate, with damping raised on any step that fails to reduce the sum of squares. Rows whose y is not positive are excluded and counted, because the logarithm is undefined there and dropping them silently is the standard behaviour this page exists to correct. The suite asserts that the iterative fit never leaves more squared error than the linearised one across 600 random datasets and strictly beats it on the overwhelming majority, checks the Levenberg-Marquardt result against an independent grid search, and pins the preset’s two rates, two doubling times and 4.79× error ratio as exact figures. That engine is verified on every change against 188 assertions. The count and the per-case breakdown are published on the formula verification page.

Related calculators

Where this goes next:

Coefficient of DeterminationR-squared across five models at once with adjusted R-squared beside it, because adding a term can never lower it and the value most tools report for a curve fit was computed in log space.
Power RegressionFits y = ax^b and reads b as what it is — a dimensionless elasticity. Change the units in one click and watch the coefficient move by a million while the exponent holds; fed the eight planets it returns Kepler's 1.4997.
Logarithmic RegressionFits y = a + b·ln x and reports what one doubling of x adds to y — the constant increment that defines the shape, and the only log-transformed fit on this site whose R² needs no caveat.
Quadratic RegressionFits y = a + bx + cx² and prints the vertex, which is the optimum a dose-response curve is fitted to find — plus whether that turning point falls inside your data or is being assumed by the shape.
Linear RegressionThe least-squares line with r and r² — and the regression of x on y beside it, because those are two different lines rather than one line rearranged.
ResidualResiduals, standardised and studentised residuals, leverage and Cook's distance, with Anscombe's quartet built in — including the dataset every residual rule scores cleanest and which one point controls entirely.

More in Math, or browse all calculators.

Educational use disclaimer

An educational tool. An exponential fit describes the range of data it was given and assumes a constant proportional rate; real growth saturates and real decay hits a floor, and no fit statistic reveals when that has started.

How we calculate · Found an error? email us

Authorship & verification

Written and maintained by , a business operator who builds spreadsheet-based calculators.

What's changed (4 updates)

Published 12 September 2026

  1. Published an exponential regression that runs BOTH fits: the usual least squares on ln y, which every other calculator performs because it has a closed form, and Levenberg-Marquardt on the untransformed residuals, which is the fit that actually minimises squared error in the data's units. They are different curves.
  2. On the built-in signups preset the linearised fit leaves 4.79 times the squared error — 53,500,337 against 11,174,497 — and puts the doubling time at 0.92 months against 1.00. The doubling time is the figure people quote, and it is out by 8% for a reason nobody states.
  3. Reports three R-squared values rather than one: 0.999806 in log space, which is what competitors print; 0.994214 for that same curve measured against the actual y values; and 0.998792 for the curve that minimises error on the data. All three are correct answers to different questions.
  4. Counts the rows dropped because y was not positive instead of discarding them silently, and states which noise model each fitting objective corresponds to — lognormal multiplicative error for the linearised fit, additive normal for the other — so the choice is stated rather than made by whichever tool was opened.

Add this calculator to your site

Responsive embed — and private: nothing your visitors type leaves their browser.