curve.fit for teaching labs

Fit lab data with uncertainties in x and y. Hand in a clean PDF.

curve.fit is a free web tool for fitting models to experimental data. Students paste their measurements, choose a model, and get fitted parameters with 1σ uncertainties, residuals and a report ready for the lab notebook. It runs in any browser, with nothing to install and no accounts.

23456702468xy
m = −0.4805 ± 0.0706b = 5.480 ± 0.359χ²red = 1.48

Pearson’s data with York’s weights (Pearson 1901; York 1966), fitted on curve.fit with uncertainties in both coordinates. The shaded band is the 68% model uncertainty. Published result: m = −0.48053, b = 5.4799 (Cantrell 2008).

1,000,000+fits run since 2019
26built-in models, plus custom equations
55NIST reference fits checked before every release
$0free to use, no install, no accounts
Uncertainties done properly

Both error bars count

Spreadsheet trendlines ignore measurement uncertainty. curve.fit uses orthogonal distance regression (ODRPACK95, through the odrpack package) when students supply δx and δy, so every point is weighted by its uncertainty in both directions. With δy only it runs weighted least squares; with neither, ordinary least squares.

  • Uncertainties come from a table column per point, or from one constant or percentage for the whole dataset.
  • Students choose how parameter uncertainties are reported. Absolute uses the supplied 1σ values as given. Nominal, the default, rescales by √χ²red, the same default as SciPy, lmfit and Origin.
  • Every fit shows a model uncertainty band and a residual plot.
  • The Model Evaluator predicts y ± δy at any x, propagating parameter uncertainty and an optional δx.
Uncertainties suppliedFitting methodChecked against
NoneOrdinary least squares in yNIST reference datasets and a closed-form linear regression
δy onlyWeighted least squares in yAn independent weighted linear regression, including parameter uncertainties
δx onlyOrthogonal distance regression, exact-y limitAn independent regression of x on y, transformed back
δx and δyWeighted orthogonal distance regressionThe Pearson–York benchmark and an independent implementation of York’s equations
Numerical correctness

Checked against published reference results

Before every release, an automated suite fits reference datasets with known answers and compares parameters, standard errors and residual sums of squares. The details, tolerances and references are published in the Help.

NIST Statistical Reference Datasets

21 datasets, 4 linear and 17 nonlinear, fitted from 55 certified and published starting points. Parameters, standard errors and residual sums of squares must match NIST’s certified values.

relative tolerance 1 × 10⁻⁶

Pearson–York benchmark

The classic test for fitting with errors in both variables: Pearson’s data with York’s weights, compared with the published results in Cantrell (2008). Load it in one click to show a class.

m = −0.48053   b = 5.4799
References
  1. Pearson, K. (1901). On lines and planes of closest fit to systems of points in space. Philosophical Magazine, 2, 559–572.
  2. York, D. (1966). Least-squares fitting of a straight line. Canadian Journal of Physics, 44, 1079–1086.
  3. Cantrell, C. A. (2008). Technical Note: Review of methods for linear least-squares fitting of data and application to atmospheric chemistry problems. Atmospheric Chemistry and Physics, 8, 5477–5487. doi:10.5194/acp-8-5477-2008
  4. NIST Statistical Reference Datasets, nonlinear and linear regression. nist.gov/itl/sed
Lab-ready output

A one-page report for every fit

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

  • Single PDF for one report. Double PDF prints two copies side by side for lab partners.
  • Titles and axis labels accept LaTeX math, typeset with TeX.
  • Browser Report opens the fit with full-precision tables and model samples, with CSV and JSON downloads for further analysis.
  • Each report is stamped with its session, fit ID and time, so an instructor can open the fit behind a submitted report.
Top of a curve.fit Single PDF report: model box for Linear, y = mx + b, reduced chi-squared 1.48, a parameter table with m and b and their uncertainties, and the plot of Pearson's data with error bars and a shaded uncertainty band.
Top of the Single PDF for the Pearson–York example. The full page adds the residual plot. Example reports: Single PDF · Double PDF.
Easy for students

Productive in minutes

The curve.fit workspace: data table with x, δx, y and δy on the left; plot with error bars and fitted line; model, uncertainty and label settings; parameter table; results with reduced chi-squared; and Single PDF, Double PDF and Browser Report buttons.
The workspace after fitting the Pearson–York example. Setup and each saved fit have their own tab.
  1. Paste the data

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

  2. Choose a model

    Pick one of 26 models or type an equation. Starting values are automatic.

  3. Fit

    Read the parameters, reduced χ² and residuals. Each fit opens in its own tab.

  4. Predict

    Use the Model Evaluator to get y ± δy at any x.

  5. Export

    Download the PDF for the lab report, or the data as CSV.

  • A guided walkthrough fits a sample dataset in about five minutes, in a separate practice tab.
  • Custom equations use x and up to five parameters, A to E, with common functions and π. The equation is checked as students type, and a matching built-in model is suggested when there is one.
  • Every fit is saved to a session link. Students can return later, compare earlier fits, or fork a copy to try something new.
Model library

Models for physics, chemistry and biology labs

Arrhenius Cauchy Cubic Damped Oscillator Exponential with Offset Gaussian Hill Sigmoid (4 Parameter) Inverse Linear Logistic Lorentzian Malus’s Law Natural Log Oscillator Poisson Power Law Power Law with Offsets Power Law with Vertical Offset Quadratic Quartic Saturation (Michaelis–Menten) Shifted Reciprocal Stokes Law Two Slit Interference Weighted Mean X Log X Custom equation (A–E)
For instructors

Easy to adopt across sections

One method for every section

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

Share a dataset as a link

Fit an example once and share its session link. Reference examples such as Pearson–York and several NIST datasets load in one click.

Documented methods

The Help explains the fitting modes, uncertainty conventions, model bands and validation, with references students can cite.

Reproducible in Python

A short SciPy template performs the same kind of ODR fit, for courses that want students to see the code.

Nothing to administer

No installs, licenses or student accounts. It runs in any modern browser on lab computers and laptops.

Free to use

There is no cost to students or departments.