Using the MSE Calculator — Mean Squared Error
Mean Squared Error (MSE) measures how far a set of predictions is from the actual observed values. For each data point you take the error — the actual value minus the predicted value — square it, and then average those squared errors across all points. Squaring guarantees every error contributes positively (so positive and negative errors don't cancel) and it penalizes large mistakes far more than small ones, which is exactly what you want when big misses are costly.
The formula
For n paired observations where yi is the actual value and ŷi is the predicted value:
MSE = (1/n) Σi=1n (yi − ŷi)²
The related metrics this calculator also reports are the RMSE (Root Mean Squared Error, √MSE), which converts the result back to the original units of your data, and the MAE (Mean Absolute Error, the average of |yi − ŷi|), which treats all errors linearly instead of squaring them.
A worked example
Take actual values [3, −0.5, 2, 7] and predicted values [2.5, 0.0, 2, 8]. The errors are 0.5, −0.5, 0, and −1. Squaring gives 0.25, 0.25, 0, and 1, which sum to 1.5. Dividing by n = 4 gives MSE = 0.375. Then RMSE = √0.375 ≈ 0.6124, and MAE = (0.5 + 0.5 + 0 + 1)/4 = 0.5. This matches the canonical example used in most machine-learning libraries.
Why MSE is used
- Regression evaluation. MSE is the standard scoring metric for regression models — linear regression, gradient boosting, neural networks — because it is smooth and differentiable, which makes it ideal as a loss function for optimization.
- Forecast accuracy. Demand, weather, and financial forecasts are routinely graded by MSE or RMSE against what actually happened.
- Sensitivity to outliers. Because errors are squared, a single large miss dominates the score. If you want a metric that is more robust to outliers, compare against MAE.
Reference points
MSE has no fixed "good" value — it depends entirely on the scale of your data. An MSE of 25 is small if your values run in the thousands and enormous if they run between 0 and 1. That is why RMSE is often preferred for reporting: an RMSE of 5 means the typical prediction is off by roughly 5 units. A model that predicts perfectly has MSE = 0. As a rule of thumb, MSE ≥ RMSE ≥ MAE never holds in general, but MSE will always be at least RMSE² and RMSE will always be ≥ MAE for the same errors.