Data Analysis

Non-Linear Curve Fitter

Paste your raw X/Y coordinates to instantly perform least-squares regression modeling. Extract optimal coefficients and R² values securely in your browser.

100% client-side

1. Input Data

Column Mapping

2. Regression Model

How this model is fitted and scored
Examples:
Mathematical Model
R² = ,

Awaiting data...

How-To Guide

How to fit a curve to your data

Paste columns of numbers, choose a model, and read off the fitted equation, R² and RMSE, all computed locally in your browser.

1

Paste Data

Enter your data columns separated by spaces, tabs or commas | one point per line. Or click Load example data.

2

Map Columns

Tell the tool which columns represent your X (independent) and Y (dependent) variables.

3

Choose a model

Pick linear, polynomial, exponential, power or logarithmic from the dropdown, based on the shape you expect.

4

Check the fit

Click Compute Fit. Read R² and RMSE, watch for the overfitting warning, then use Copy Eq to grab the equation.

How the fitting works

Least-squares regression

Linear and polynomial models are fitted by ordinary least squares. R² (coefficient of determination) reports the fraction of variance explained; RMSE is the typical residual size in the units of Y. Both are computed on your original data.

Linearised non-linear models

Exponential, power and logarithmic fits are obtained by transforming the data (fitting a straight line in log-space). This is fast and standard, but it minimises error on the transformed data, so parameters can differ from a true non-linear least-squares fit when values span several orders of magnitude.

Watch out for overfitting. A model with as many parameters as data points will pass through every point and report R² = 1, even if the underlying relationship is different. A cubic needs several points beyond its 4 parameters before R² becomes meaningful; the tool warns you when your sample is too small for the chosen model.
Method & Equations

The math behind the fit

Fits are computed by least-squares regression and assessed with R² and RMSE, all in your browser.

Parameters are chosen by ordinary least squares, minimising the residual sum of squares:

minθi=1n(yif(xi;θ))2

Goodness of fit is reported with the coefficient of determination and the root-mean-square error:

R2=1i(yiy^i)2i(yiy¯)2
RMSE=1ni=1n(yiy^i)2

where yi are the observed values, y^i the fitted values, y¯ the mean of y, and n the number of points. R2 and RMSE are computed on the original data.

Model forms available:

  • Linear y=mx+c
  • Polynomial y=k=0dakxk (degree d = 2 or 3)
  • Exponential y=aebx → fitted as lny=lna+bx
  • Power y=axb → fitted as lny=lna+blnx
  • Logarithmic y=a+blnx

The exponential, power and logarithmic models are fitted by linearisation (least squares on the transformed variables), which minimises error in log-space rather than in the original space.

References & documentation

  1. Draper, N. R., & Smith, H. (1998). Applied Regression Analysis (3rd ed.). Wiley.
  2. Heckert, N. A., Filliben, J. J., Croarkin, C., et al. (2002). NIST/SEMATECH e-Handbook of Statistical Methods, Ch. 4 “Process Modeling”. itl.nist.gov/div898/handbook.
  3. Wikipedia: Least squares · Coefficient of determination.
  4. Regression library: regression.js (Tom Alexander).

Frequently asked questions

Is my data sent to a server?
No. Parsing, fitting and plotting all happen in your browser using regression.js and Plotly.
Why does my exponential fit look slightly off?
Exponential/power/logarithmic models are fitted by linearisation (least squares in log-space), not true non-linear least squares, so the curve can look biased when data spans many orders of magnitude.
What do R² and RMSE mean?
R² is the fraction of variance the model explains (1 is perfect). RMSE is the root-mean-square residual, in the same units as Y, smaller is better.
Why did I get a warning about too few points?
If you have as many (or fewer) points as the model has parameters, the fit is exact or under-determined and R² is not informative. Add more data.
Which model should I pick?
Match the expected shape: straight line → linear; growth/decay → exponential; curves through the origin → power; diminishing returns → logarithmic; one/two bends → polynomial 2/3.

Runs entirely in your browser, no data leaves your device.