What Is Mean Squared Error?
Mean squared error is the average of the squared differences between actual and predicted values. Squaring makes every error positive and punishes large errors more than small ones, which is why MSE is a common loss function for regression models and forecasts.
MSE is in squared units, so the calculator also gives RMSE (its square root, in the original units), the mean absolute error, the mean absolute percentage error and the mean error, which shows whether predictions are biased high or low. Reading them together tells you which metric to trust for your problem.
Below you will find the formulas, a variables table, a worked example and answers to common questions such as MSE versus RMSE and when MAPE is a poor choice.
How to Use the Mean Squared Error Calculator
- Enter the observed values and the predictions in the same order.
- Read MSE and RMSE for overall accuracy and compare RMSE with MAE.
- Check the bias: a non-zero mean error means predictions are systematically high or low.
- Use the chart and error table to find the observations that cause the largest errors.
Mean Squared Error Formula
Mean squared error
Root mean squared error
Mean absolute error
Mean absolute percentage error
Mean Squared Error Variables Explained
| Symbol | Meaning | Notes |
|---|---|---|
| MSE | Mean squared error | Σ (yᵢ − ŷᵢ)² ÷ n |
| RMSE | Root mean squared error | √MSE |
| MAE | Mean absolute error | Σ |yᵢ − ŷᵢ| ÷ n |
| yᵢ, ŷᵢ | Actual and predicted values | |
| n | Number of pairs |
Mean Squared Error Worked Example
Using the example values (press “Load example” above to try them):
- Subtract: error = actual − predicted, for each pair.
- Square each error and add them: Σe² = 7.5.
- MSE = Σe² ÷ n = 7.5 ÷ 7 = 1.071429.
- RMSE = √1.071429 = 1.0351.
Result: Mean squared error (MSE) = 1.071429; Root mean squared error (RMSE) = 1.0351.
MSE, RMSE, MAE and MAPE: choosing a metric
RMSE is always at least as large as MAE. The gap between them shows how uneven the errors are: if RMSE is much larger than MAE, a few big misses dominate. If they are nearly equal, errors are similar in size.
| Metric | Units | Outlier sensitivity | Use it when |
|---|---|---|---|
| MSE | Squared units | Very high | Training a model, theory |
| RMSE | Data units | High | Large errors are especially costly |
| MAE | Data units | Low | You want a typical miss, robust to outliers |
| MAPE | Percent | Moderate | Comparing across scales (actuals must not be 0) |
| R² | None | High | Share of variance explained |
What is a good MSE?
There is no universal good MSE, because it depends on the scale of the data. Compare it with a baseline such as always predicting the mean (its MSE equals the variance of the actual values), or compare RMSE with the standard deviation of the target. A model whose RMSE is well below the target’s standard deviation is adding real information. Also evaluate on data the model has not seen, since training MSE can be misleadingly low.
MSE, bias and variance
For an estimator, MSE equals variance plus squared bias. That is why a slightly biased estimator with low variance can beat an unbiased one with high variance. The mean error shown in the results is the bias of the forecast on this data set.
Where Mean Squared Error Is Used
Evaluating a regression model
Scoring predictions on test data.
Comparing forecasts
Ranking forecasting methods on the same actual values.
Choosing a metric
Seeing how MSE, RMSE and MAE respond to large errors.
Detecting bias
Checking whether predictions run consistently high or low.
Common Mean Squared Error Mistakes to Avoid
- Always compare predictions to the same-order actual values.
- Report RMSE, not MSE, to a non-technical audience.
- Do not use MAPE when actual values can be 0 or near 0.
- Evaluate on held-out data to avoid overfitting.
Mean Squared Error Terms and Definitions
- Loss function
- A formula that scores how wrong a prediction is; MSE is the squared-error loss averaged over data.
- Bias
- The average signed error; shows systematic over- or under-prediction.
Mean Squared Error FAQs
What does mean squared error measure?
The average squared difference between predictions and actual values. Smaller values mean predictions are closer to the truth.
How do you calculate MSE?
Subtract each prediction from the actual value, square the differences, add them and divide by the number of observations.
What is the difference between MSE and RMSE?
RMSE is the square root of MSE, which returns the error to the original units of the data.
Is MSE or MAE better?
Neither is universally better. MSE penalises large errors more, so it suits cases where big misses are costly; MAE is more robust to outliers and easier to explain.
Can MSE be negative?
No. Squared numbers are never negative, so MSE is zero or positive, and zero only for perfect predictions.
What is MSE in machine learning?
It is the most common loss for regression problems. Models are trained to minimise it, and it is also used to evaluate them on test data.