# Curve Fitter & Regression Calculator > Fit lines, polynomials, exponentials or your own model: parameters, R², errors, residuals. Paste x/y data (CSV, tabs or spaces) and fit a straight line, polynomial, exponential, power-law, logarithmic, multiple linear or your own nonlinear model, or interpolate with a natural cubic spline. You get the parameters with standard errors, t and p values and confidence intervals, R² and adjusted R², an ANOVA table, a residual plot and predictions with confidence intervals. Verified against the NIST StRD reference datasets; part of the Proofline math notebook. Part of usefulweb.app (https://usefulweb.app/). Part of [Proofline](https://proofline.usefulweb.app/) (ownerApp: proofline). Results are deterministic calculations from the inputs and the listed assumptions; the API returns exactly what the web page shows. ## Use it - Human interface: https://prooflinecurvefit.usefulweb.app/ (interactive tool at https://prooflinecurvefit.usefulweb.app/tool) - JSON API: POST https://prooflinecurvefit.usefulweb.app/api/v1/calculate with a JSON object of inputs (schema: https://prooflinecurvefit.usefulweb.app/api/v1/tool) - OpenAPI: https://prooflinecurvefit.usefulweb.app/openapi.json - MCP (Streamable HTTP): https://prooflinecurvefit.usefulweb.app/mcp - tool `proofline_curve_fit` ## Inputs - data (textarea, required): Data - One row per line, values separated by commas, tabs, semicolons or spaces; an optional header row names the columns. Use a decimal point (1.5). - model (select): Model - xColumn (text): x column - Column number (1 = first) or header name; default the first column. Multiple regression: a comma-separated list (default: every column except y). - yColumn (text): y column - Column number or header name; default the second column. - degree (integer): Polynomial degree - intercept (boolean): Include an intercept (constant term) - Straight line, polynomial and multiple regression. Without it the fit goes through the origin and R² is uncentred. - expression (text): Custom model y = - Formula in x and your parameters. Use + − * / ^, implicit products (2x), sin, cos, tan, exp, ln (natural log), log (base 10), sqrt, abs, pi and e. Angles are in radians. - parameters (text): Parameters with start values - Custom model: every parameter with a start value. Start values near the solution help Levenberg–Marquardt. - evaluateAt (text): Evaluate the fit at x = - Optional list of x values: predicted y with standard error and confidence interval (interpolated value for splines). - confidence (number): Confidence level ## Method - Models that are linear in their parameters (line, polynomial, multiple, logarithmic) are solved by Householder QR of the column-scaled design matrix — never by the normal equations, which square the condition number. - Exponential, power and custom models use Levenberg–Marquardt: each damped step solves [J; √λ·D]·δ ≅ [r; 0] by QR with D the column norms of the central-difference Jacobian. Exponential and power fits start from the log-linear fit but minimise the residuals of y itself. - Standard errors are √diag(s²·(RᵀR)⁻¹) with s² = SSE/(n − p); t and p values and confidence intervals use Student’s t with n − p degrees of freedom. For nonlinear models these are the usual linearised (asymptotic) values. - R² = 1 − SSE/SST (centred); without an intercept R² is uncentred, as in the NIST datasets. The F test compares the model with a constant. - Verified against NIST StRD certified values: Norris, Pontius, NoInt1, Longley, Wampler1 and Filip (linear) and Misra1a, Thurber, DanWood, Chwirut2 and MGH09 (nonlinear, both start points) — at least 7 matching digits for the parameters. - Splines: natural cubic spline (second derivative zero at both ends) from a tridiagonal system; outside the data the end cubics are continued and flagged as extrapolation. ## Limits - Regression statistics assume independent errors with constant variance. A high R² does not prove that the model is right — check the residual plot for patterns.