MSE Calculator — Mean Squared Error

Enter your actual and predicted values to compute the Mean Squared Error, MSE = (1/n) Σ(actual − predicted)², along with RMSE and MAE and step-by-step working.

Separate values with commas, spaces, or new lines. Both lists must have the same number of values.

Quick Facts

Formula
MSE = (1/n) Σ(actualᵢ − predictedᵢ)²
Averages the squared errors; larger errors are penalized more heavily. RMSE = √MSE returns the value to the original units.

Your Results

Calculated
Mean Squared Error (MSE)
-
Average of squared errors (squared units)
Root MSE (RMSE)
-
√MSE, in original units
Mean Absolute Error (MAE)
-
Average of |error|
Data points (n)
-
Paired observations used

Ready

Enter matching actual and predicted lists, then click Calculate.

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.

Frequently Asked Questions

What is the formula for MSE?
Mean Squared Error is the average of the squared differences between actual and predicted values: MSE = (1/n) Σ(yi − ŷi)², where yi is the actual value, ŷi is the predicted value, and n is the number of paired observations.
What is the difference between MSE and RMSE?
RMSE (Root Mean Squared Error) is simply the square root of MSE. Because MSE is in squared units, it can be hard to interpret; taking the square root returns the metric to the same units as your original data, so an RMSE of 5 means the typical error is about 5 units.
Is a lower MSE always better?
Within one dataset, a lower MSE means predictions are closer to the actual values, so lower is better. But MSE is scale-dependent and cannot be compared across datasets with different units. Also, an MSE of 0 on the data a model was trained on often signals overfitting rather than a genuinely good model — always evaluate on held-out data.
How is MSE different from MAE?
MAE (Mean Absolute Error) averages the absolute errors, treating a miss of 2 as exactly twice as bad as a miss of 1. MSE squares the errors, so a miss of 2 counts four times as much as a miss of 1. MSE therefore reacts strongly to outliers; MAE is more robust to them.