curve.fit

Tour of curve.fit

Fit your data with its uncertainties in x and y.

Paste measurements from a spreadsheet, choose a model, and get every parameter with its uncertainty, a plot with residuals and a one-page report. Free, in any browser, with no install or account.

A 58-second silent tour with on-screen captions, using Pearson's data with York's weights. The chapters below describe each step.

  1. Copy x, δx, y and δy from a spreadsheet, or import a CSV file of up to 10,000 rows.

  2. Choose Table for δx and δy, and each point is weighted by its uncertainty in both directions.

  3. Or type your own equation. curve.fit suggests a matching built-in model.

  4. Every parameter comes with its uncertainty, plus reduced χ² and residuals. This fit matches the published Pearson–York result.

  5. A one-page PDF with the model, parameters, plot and residuals. Excel and Browser Report too.

1,000,000+fits run since 2019
35built-in models, plus equations you type
55NIST reference fits checked before every release
$0free to use, with no install and no accounts

Uncertainties done properly

x and y errors supported

Spreadsheet trendlines ignore measurement uncertainty. When you supply δx and δy, curve.fit uses orthogonal distance regression (ODRPACK95), so every point is weighted by its uncertainty in both directions.

  • Uncertainties come from a column per point, or from one constant or percentage for the whole dataset.
  • Absolute uses your 1σ values as given. Nominal, the default, rescales by √χ²red, the same default as SciPy, lmfit and Origin.
  • Evaluate predicts y ± δy at any x, or solves for x from a measured y.
You supplycurve.fit fits with
NoneOrdinary least squares in y
δy onlyWeighted least squares in y
δx onlyOrthogonal distance regression, exact-y limit
δx and δyWeighted orthogonal distance regression

Numerical correctness

Checked against published answers

Before every release, an automated suite fits reference datasets with known answers and compares parameters, standard errors and residual sums of squares.

NIST Statistical Reference Datasets. 21 datasets, 4 linear and 17 nonlinear, fitted from 55 certified and published starting points, must match NIST's certified values.

relative tolerance 1 × 10⁻⁶

Details, tolerances and references are in the Help.

Pearson–York benchmark Pearson’s data with York’s weights, fitted with a straight line Ten points with error bars in x and y, the fitted line y = −0.4805x + 5.480 and its ±1σ band, falling from about 6 at x = 0 to about 1.5 at x = 8. 0 2 4 6 8 2 4 6
Published · Cantrell (2008) m = −0.48053 b = 5.4799
curve.fit, the fit in the tour m = −0.48053 b = 5.4799

Pearson's data with York's weights is the classic test for fitting with errors in both variables.

Model library

35 models, or your own equation

Every model has its own page with the equation, what each parameter means and tips for fitting it. A custom equation uses x and up to five parameters, A to E. curve.fit checks it as you type and suggests a matching built-in model.

Browse the models

  • Arrhenius
  • Cauchy
  • Cubic
  • Damped Oscillator
  • Double Exponential
  • Driven Oscillator Amplitude
  • Exponential Decay (Half-life)
  • Exponential Decay (Time Constant)
  • Exponential with Offset
  • Gaussian
  • Gaussian on Linear Background
  • Inverse
  • Linear
  • Logistic
  • Logistic 4PL (Hill)
  • Logistic 5PL
  • Logistic with Baseline
  • Lorentzian Peak
  • Malus’s Law
  • Natural Log
  • Oscillator
  • Poisson
  • Power Law
  • Power Law with Offsets
  • Power Law with Vertical Offset
  • Quadratic
  • Quartic
  • RLC Resonance
  • Saturation (Michaelis–Menten)
  • Shifted Reciprocal
  • Single Slit Diffraction
  • Stokes Law
  • Two Slit Interference
  • Weighted Mean
  • X Log X
  • Custom equation (A–E)

Lab-ready output

A one-page report for every fit

Every fit exports a PDF with the model and equation, the fitted parameters with their uncertainties, reduced χ², the plot with error bars and uncertainty band, and the residuals.

Example reports for the Pearson–York fit: Single PDF · Double PDF

  • Single PDF for one report. Double PDF prints two copies side by side for lab partners.
  • Titles and axis labels accept LaTeX math and symbols such as °, µ, ± and Greek letters.
  • Browser Report opens the fit with full-precision tables, with CSV, JSON and Excel downloads.
  • An XLSX workbook holds the same tables and the plot. The plot toolbar saves PNG or SVG images for slides.
  • Each report is stamped with its session, fit ID and time, so an instructor can open the fit behind it.

Teaching a lab?

One method for every section

Every student uses the same fitting method and reporting conventions, whatever computer they have.

Get started

Try it with your own data

A guided walkthrough fits a sample dataset in about five minutes, in a separate practice tab.