fitline.

STRAIGHT-LINE LEAST SQUARES / ENTERED PAIRS

Find a line.
Keep the differences.

Fit one unweighted line to your x/y pairs. Read the slope, intercept and every residual, with exact decimal-input arithmetic behind the rounded view.

Free · Browser-local · No account or upload

ŷ = a + b × x

A line summarises. Residuals show what remains.

01 / YOUR OBSERVATIONS

One pair on each line.

2–100 rows. Comma or whitespace between x and y; blank lines are ignored. No header. Use consistent units within each variable.

A line evaluation is model arithmetic, not a prediction guarantee. Outside-range entries are labelled.

Signed plain decimals, up to 9 decimal places and magnitude 1,000,000,000. Use 0.5 rather than .5. No exponents, commas inside a number, or measurement units in the input.

02 / THE ENTERED-DATA FIT

ŷ = a + b × x

Slope b

Intercept a

Sum of squared residuals

R²

equally weighted rows. Decimal views round to at most 10 places. Exact fractions describe entered numbers, not measurement accuracy.

Points are entered y values; the red line is the fitted model across the entered x range. Dashed distances show residuals. Chart positions are rounded for drawing.

Rounded per-row values; exact values are retained in local reports.
RowxyFitted yResidual

A high R² does not establish causation, a suitable model, or reliable future results. Constant y has undefined R² here.

THE RULE

Minimise the squared
vertical differences.

This calculator chooses the slope and intercept that minimise Σ(y − ŷ)² for the entered rows. It includes an intercept and gives every row equal weight. Swapping x and y asks a different question.

Read the equations and worked examples →