Residual Calculator

Enter the observed and predicted values to compute the residual.

How it is calculated

For one data point the tool computes three numbers. Residual: e = observed − predicted, so a negative value means the model overshot. Absolute residual: |e|. Percent residual: e ÷ observed × 100, measured against the observed value, not against the prediction. The first two are shown with two decimals, the percentage rounded to two decimals as well. If observed is exactly 0 the percentage cannot be computed and the tool prints n/a instead. When the observed value is negative, dividing by it flips the sign of the percentage, so read it together with the plain residual. Units of the first two numbers are those of your data.

Worked example

A model predicts 52.5 for a data point whose observed value is 48. Residual: 48 − 52.5 = -4.50. Absolute residual: |−4.50| = 4.50. Percent residual: −4.5 ÷ 48 = −0.09375, times 100 = −9.375, shown as -9.38%. The negative sign says the model predicted too high by 4.5 units, which is about 9.4% of the observed value. Had the observed value been 0 with the same prediction, the percentage line would show n/a.

Try this example →

Common mistakes

  • Subtracting in the wrong order: the tool uses observed minus predicted, so predicted minus observed flips every sign and a negative residual here means the model overestimated.
  • Dividing by the prediction to get the percent: this tool divides by the observed value, so the percentage differs from the one you get with the predicted value as the base.
  • Averaging signed residuals and concluding the fit is perfect: positive and negative residuals cancel, so use the absolute values when judging the size of the errors.
  • Trusting the percent residual when observed is close to zero: the percentage becomes huge and unstable, and is n/a at exactly 0.
  • Entering a fitted value from a rounded model output: residuals are small differences, so rounding the prediction first can change their sign or size.

About this calculator

In regression and statistical modeling, a residual is the difference between what was actually observed and what a model predicted: residual = observed − predicted. This calculator also computes the absolute residual (its magnitude regardless of sign) and the percent residual (the residual as a percentage of the observed value), giving three views of the same gap in fit.

Statistics students, data analysts and researchers examine residuals to judge how well a regression line or model fits the data — plotting residuals against predicted values (a residual plot) reveals patterns a simple R² can hide, such as heteroscedasticity (residual spread growing with the predicted value) or nonlinearity (a curved pattern indicating a linear model is the wrong choice). A residual's sign also matters directly: a positive residual means the model underestimated that observation, a negative one means it overestimated it.

Was this helpful?

You can pick up to 3 reactions.

Be the first to comment.

Popular calculators

All Calculators