Enter the actual and predicted values into the calculator to determine the squared error. This calculator helps in assessing the accuracy of predictions in statistics and machine learning.

Squared Error Calculator

Enter any 2 values to calculate the missing variable

Squared Error Formula

Squared error measures how far a predicted value is from the actual value after the difference is squared. It is a core error metric in statistics, forecasting, regression, and machine learning because it heavily penalizes larger misses.

SE = (AV - PV)^2
  • SE = squared error
  • AV = actual value
  • PV = predicted value

If the prediction is perfect, the squared error is zero. As the prediction moves farther away from the actual value, the squared error increases rapidly because the difference is squared rather than left as a simple distance.

How to Calculate Squared Error

  1. Determine the actual value.
  2. Determine the predicted value.
  3. Find the prediction error by subtracting the predicted value from the actual value.
  4. Square that error to remove the sign and emphasize larger deviations.
e = AV - PV
SE = e^2

This means an underprediction and an overprediction of the same size produce the same squared error. For example, missing by 5 in either direction gives a squared error of 25.

Example

If the actual value is 100 and the predicted value is 90, then:

SE = (100 - 90)^2 = 10^2 = 100

The model missed by 10 units, and the squared error is 100.

Why Squared Error Is Useful

  • Non-negative result: The value is always zero or positive.
  • Perfect-fit benchmark: A result of zero means no prediction error.
  • Larger mistakes matter more: Squaring makes large misses much more costly than small ones.
  • Optimization-friendly: Many statistical and machine learning methods are designed around minimizing squared error.

How to Interpret the Result

A smaller squared error indicates a prediction that is closer to the actual value. A larger squared error indicates a poorer prediction. Because the value is squared, its units are also squared. If the original measurement is in meters, the squared error is in square meters. That is useful mathematically, but it can feel less intuitive in practical interpretation.

For that reason, squared error is often used as a building block for broader metrics across many observations rather than as the only number used for interpretation.

Related Error Metrics

Metric Formula What It Tells You
Signed Error
e = AV - PV
Shows direction of the miss. Positive and negative errors can cancel out across multiple predictions.
Absolute Error
AE = |AV - PV|
Measures the size of the miss without direction and without extra penalty for large errors.
Squared Error
SE = (AV - PV)^2
Emphasizes larger misses more strongly than absolute error.
Mean Squared Error
MSE = \frac{1}{n}\sum_{i=1}^{n}(AV_i - PV_i)^2
Average squared error across many predictions.
Root Mean Squared Error
RMSE = \sqrt{MSE}
Returns the error to the original unit scale, making interpretation easier.

When to Use a Squared Error Calculator

  • Evaluating a single prediction against an actual outcome
  • Checking how far a regression estimate is from an observed value
  • Comparing prediction quality across different models
  • Building or validating machine learning loss calculations
  • Preparing inputs for mean squared error or root mean squared error analysis

Important Notes

  • Swapping the actual and predicted values does not change the squared error because the difference is squared.
  • Squared error grows quickly as the miss gets larger, so outliers have a strong effect.
  • A single squared error describes one prediction. To evaluate full model performance, use a summary metric such as mean squared error.
  • If you need a more intuitive interpretation in the original units, root mean squared error is often preferred.

Frequently Asked Questions

Can squared error be negative?

No. Because the difference is squared, the result is always zero or positive.

What does a squared error of zero mean?

It means the predicted value exactly matches the actual value.

Why is squared error sensitive to outliers?

Large errors are squared, so they increase much faster than small errors. A miss of 10 contributes far more than two misses of 5.

10^2 = 100
5^2 + 5^2 = 50

Is squared error the same as variance?

No. Squared error compares a prediction to an actual value. Variance measures how spread out values are around their mean. They are related mathematically, but they are not the same concept.