Fits y = axb, and treats b as the finding rather than a coefficient.
y = axb, and b does not care about units
Both x and y must be positive: the fit takes the logarithm of each. Semi-major axis in AU against orbital period in years. Kepler’s third law says the exponent is exactly 3/2.
y = 1.000286·x^1.499713
Exponent b = 1.499713
Multiply x by any factor k and y is multiplied by k^b — exactly, at every x. A 1% rise in x moves y by 1.5035%.
Exponent b
1.499713
dimensionless — an elasticity
Coefficient a
1.000286
carries all the units
Doubling x multiplies y by
2.827864
2^b, at any scale
Least-squares b
1.499863
vs 1.499713 from log-log
R² (on the data)
1.000000
what the curve achieves
R² (log-log)
1.000000
what competitors print
Residual std error
0.0117
on 6 degrees of freedom
Rows dropped
0
none
Press one of the scale buttons above. Multiplying x or y by a thousand changes the coefficient a by a factor of a thousand or more — and leaves b exactly where it was. The verification suite checks this across 300 random datasets and unit changes spanning ten orders of magnitude, and the largest drift it finds is below 10⁻¹¹.
Log-log least squares is not least squares on your data: 1.4491× the squared error here, and an exponent of 1.499713 against 1.499863. Taking logs of both variables minimises Σ(ln y − ln ŷ)², which weights proportional error equally at every magnitude. That is often the right choice for a power law, because the data usually spans decades — but it is a choice, and the exponent it produces is not the one that minimises error in your units. The tool reports both rather than picking.
The log-log R² of 1.000000 describes the straight line through the logarithms. Against your actual y values the same curve scores 1.000000. Both are true; only the second answers “how well does this curve describe my data”. The gap is the same one the exponential page documents, and it does not arise for a logarithmic fit, which transforms only x.
What this tool shows
The exponent is the only part of a power law that means anything on its own. It is dimensionless, so it can be compared across studies that used different units — and the tool lets you prove it: rescale the data and a moves by a factor of a million while b holds to within 10⁻¹¹. Fed the eight planets, it returns 1.499713 against Kepler’s exact 3/2.
y = ax^b from log-log least squares, the standard method
And the true least-squares exponent, which is not the same number
b read as an elasticity: multiply x by k and y is multiplied by k^b
A unit-rescale control that shows the exponent is dimensionless
R² on the data alongside the log-log R² every other tool prints
Rows with a non-positive x or y excluded and counted
Dimensionless exponent Checked against Kepler Two fitting methods Elasticity reading
1.499713 from eight planets, against an exact 1.5.
Updated 12 September 2026 · Works in any browser, no installation
Power regression fits y = axb, where b is a constant elasticity. Multiplying x by any factor multiplies y by that factor raised to b — the same everywhere, which is what distinguishes a power law from an exponential, where it is adding to x that has a constant multiplicative effect.
At a glance
Formula shown
Taking logs of both sides gives ln y = ln a + b·ln x, a straight line, so b and ln a come from ordinary least squares on the log-log data and a = e^(ln a). That minimises Σ(ln y − ln ŷ)², not Σ(y − ŷ)², so the tool also runs Levenberg-Marquardt on the untransformed residuals. Rows with x ≤ 0 or y ≤ 0 have no logarithm and are excluded. Because b is a ratio of proportional changes, rescaling either variable changes only a.
Scenario support
Allometry and biological scaling, orbital mechanics and other physical laws, price elasticity of demand, the relationship between area and length or volume and mass, learning curves in manufacturing, city size against infrastructure, and any relationship that plots as a straight line on log-log paper.
Educational estimate
Planning support from the values you enter — not professional advice.
The exponent has no units, and you can watch it prove that
This is the property that makes a power law worth fitting, and it is usually stated rather than shown. The tool shows it.
Press a scale button and only a moves. Multiply x by a thousand and the coefficient changes by a factor of a thousand to the power −b; multiply y by a thousand and it changes by a thousand. The exponent stays where it was, to the last digit a double can hold.
The eight-planet preset makes the size of that clear. Fitted in astronomical units and years, a is 1.000286. Converted to kilometres and days — a change of about ten orders of magnitude in each — a becomes 2.0×10⁻¹⁰ and b is unchanged to within 4.4×10⁻¹⁶, which is floating-point noise rather than drift.
The reason is structural. Writing x′ = kx gives a(kx)ᵇ = (akᵇ)xᵇ, so the constant absorbs the unit change entirely. b measures the ratio of a proportional change in y to a proportional change in x, and proportions have no units to carry.
Which is why exponents are comparable and coefficients are not. A metabolic scaling exponent of 0.75 means the same thing whether the study weighed in grams or tonnes. A coefficient means nothing at all until you are told which units it belongs to, and that is the single most common way a published power law is misread.
The verification suite checks it as a property, not as an example. Three hundred random datasets, each refitted after multiplying x and y by independent factors spanning ten orders of magnitude; the largest exponent drift observed is below 10⁻¹¹. The same suite checks that an exponential rate does not have this property — its b has units of 1/x and scales accordingly.
Reading b as an elasticity
Economists call b the elasticity; biologists call it the scaling exponent; physicists just call it the power. They are the same number with the same reading.
Multiply x by k and y is multiplied by kb. Exactly, at every x. The tool prints 2b directly, because doubling is the comparison people reach for.
The demand preset is where this decides something. The fitted exponent is around −1, which is the boundary economists care about: at exactly −1, demand is unit elastic and revenue is flat with respect to price. Above it in magnitude, a price rise loses revenue; below it, a price rise gains revenue.
And the two fitting methods land on opposite sides of that line. Log-log least squares gives −0.965, which reads as slightly inelastic. Least squares on the data gives −0.999, which is unit elastic to three decimal places. Same seven points, opposite conclusions about whether a price rise raises revenue.
The “1% change” phrasing is an approximation. A 1% rise in x changes y by (1.01b− 1)×100%, which is 1.5037% when b = 1.5 rather than 1.5%. The tool prints the exact figure; the approximation is fine for small changes and drifts for large ones, which is precisely when people reach for it.
Exponents near round numbers are worth a second look. 0.5, 0.75, 1.5, 2, 3 recur because they come from geometry, dimension or conservation rather than from data. A fit landing at 0.748 is usually evidence for 3/4 rather than evidence against it — and a fit landing at 0.61 is usually evidence that the power law is the wrong model.
Checked against a law, not against a tolerance
Most calculators can only be checked against themselves. A power fit can be checked against physics, because several exact power laws exist with known exponents.
Kepler’s third law says T² is proportional to a³, so the period-against-axis exponent is exactly 3/2. Fed the published semi-major axes and sidereal periods of the eight planets, this tool returns 1.499713 — off by 0.00029, on real measurements spanning a factor of 78 in distance and 684 in period.
The pendulum preset is exact rather than measured. Period values computed from T = 2π√(L/g) give b = 0.5000044 and a = 2.00639, against the exact 2π/√g = 2.0064093. The small residual error is the rounding in the four-decimal inputs, not in the fit.
The allometric preset is a declared round trip. It was constructed at Kleiber’s 3/4 exponent and then rounded to one decimal place; the fit returns 0.750307. That is a check that rounding does not corrupt the recovery, and it is labelled as constructed rather than presented as measurement — a fit that recovers an exponent you put in is a test of the tool, not evidence for the law.
The suite verifies Kepler independently of the fit. It computes T²/a³ for each planet directly and checks the spread is under 0.5%, so the 3/2 is established from the data before the regression is asked to find it.
This is the kind of check a curve-fitting tool should be able to survive. An exponent is a strong claim, and a method that cannot recover a known one from clean data has no business being trusted with an unknown one.
Log-log least squares is not least squares
Every power regression you will find takes logarithms of both variables and runs a straight-line regression. That is the standard method, and it is not the fit that minimises error in your units.
It minimises Σ(ln y − ln ŷ)². Which weights a 10% miss identically whether the value is 0.02 or 4,000 — and on data spanning four decades, as power-law data usually does, that is a very different weighting from the one least squares on the raw values would apply.
So the tool runs both. Levenberg-Marquardt on the untransformed residuals, seeded from the log-log estimate, and the two exponents are printed side by side. On the demand preset they are −0.965 and −0.999, with the log-log fit leaving 2.67 times the squared error.
The R² splits the same way. The log-log figure describes the straight line through the logarithms; measured against the actual y values, the same curve scores lower. The tool prints both, because the higher one is the one every competitor displays.
For a genuine power law, log-log is often the better estimator. Power-law data usually carries proportional error — measurement precision scales with magnitude — and equal weight per proportional error is then exactly correct. This is a stronger case than the one for taking logs in an exponential fit.
But it should be a stated choice. Reporting an exponent without saying which objective produced it leaves out the thing a reader would need to reproduce it, and on data near a decision boundary — like an elasticity of −1 — the two answers differ enough to matter.
Neither fit is a test that a power law holds. Both will return an exponent for any positive data. What tests the model is whether the log-log plot is straight, and whether the residuals are structureless after the fit.
Both variables must be positive, and that excludes real cases
A power fit takes the logarithm of x and of y. Any row where either is zero or negative cannot enter it — a stricter requirement than the exponential or logarithmic fits, which each constrain only one variable.
The tool counts what it excluded. If that count is not zero, the exponent and R² describe a subset of the data and the output says how large a subset.
y = axb passes through the origin for positive b, so a zero at x = 0 is consistent with the model even though the fit cannot use it. That is a real loss: the origin is often the most certain point in a scaling dataset.
Negative values are a different problem entirely. xb is not real for negative x at most b, so a negative x is not an inconvenience but a statement that the model does not apply. The same goes for a y that crosses zero: a power law cannot change sign.
Beware the small-value leverage. On a log-log fit the smallest x values sit furthest from the centre in log space, so they carry disproportionate weight — the opposite of the intuition from the raw scale, where they look negligible. A single mismeasured value near zero can move the exponent more than an error ten times larger at the top of the range.
Which is worth checking directly. The residual calculator reports leverage per point, and running the log-log pairs through it shows which observations are actually deciding the exponent.
Power against exponential, and the test that separates them
These two are confused more often than any other pair on this site, and the confusion is about which variable the constant effect attaches to.
A power law: multiplying x has a constant multiplicative effect on y. Doubling the orbital radius multiplies the period by 21.5, whether you start at Mercury or at Neptune.
An exponential: adding to x has a constant multiplicative effect on y. Adding a month doubles the user count, whether the month is the first or the twentieth.
The plot that separates them is definitive. A power law is straight on log-log axes; an exponential is straight on semi-log axes, with only y transformed. Over a narrow range both can look plausible; over two decades only one of them will be straight.
Exponentials outgrow every power law eventually. x¹⁰⁰ loses to 1.01x given enough x. Which matters when the fit is being used to argue about what happens far outside the data, and is the reason the distinction is not cosmetic.
The domain usually settles it before the data does. Scaling relationships between two physical quantities are power laws; growth of a population or a balance over time is exponential. Choosing by R² when the mechanism already tells you is how a model ends up right about the sample and wrong about everything else.
When you genuinely do not know, fit all five. The R² calculator ranks linear, quadratic, exponential, logarithmic and power on the same data and shows the log-space gap for each, which is a better starting point than choosing a family first and defending it afterwards.
Sources and methodology
References for the method, and for the laws the presets are checked against.
Method. The standard fit is ordinary least squares on ln y against ln x, exactly as every other tool computes it, with the coefficient recovered as e raised to the intercept. Alongside it, Levenberg-Marquardt runs on the untransformed residuals from the same seed, so the two exponents can be compared like for like. Rows where x or y is not strictly positive are excluded and counted. The suite asserts that the exponent survives independent rescaling of x and y across ten orders of magnitude on 300 random datasets with a drift below 10⁻¹¹, that an exponential rate by contrast scales with the x units as it must, that T²/a³ is constant across the eight planets to within 0.5% before any regression is run, and that the fit then returns 1.4997 against Kepler’s exact 3/2. 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:
Exponential RegressionFits y = ae^(bx) by true least squares as well as by the usual log-transform, and shows the gap — on the built-in preset the standard method is out by 8% on the doubling time and leaves 4.79 times the squared error.
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.
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.
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.
An educational tool. A fitted exponent describes the range of data it was given; a straight log-log plot is weak evidence that a power law holds, and both fitting methods will return an exponent for any positive data whether or not the model applies.
Published a power regression built around the property that makes the model worth fitting: the exponent is dimensionless. Unit-scale controls let anyone check it — rescaling moves the coefficient by a factor of a million and leaves the exponent unchanged, verified across 300 random datasets and ten orders of magnitude with a drift below 1e-11.
Fed the published semi-major axes and sidereal periods of the eight planets it returns an exponent of 1.499713, against Kepler's exact 3/2. The suite also checks T-squared over a-cubed directly across the eight planets before any regression runs, so the 3/2 is established from the data rather than assumed.
Reads the exponent as an elasticity and prints the exact figure rather than the 1%-approximation. On the demand preset log-log least squares gives -0.965 and least squares on the data gives -0.999 — opposite sides of the unit-elastic boundary where a price rise stops losing revenue.
Shows the log-log R-squared beside the R-squared the curve achieves on the data, and counts rows dropped because x or y was not positive — a stricter requirement than the exponential or logarithmic fits, which each constrain only one variable.
Add this calculator to your site
Responsive embed — and private: nothing your visitors type leaves their browser.