Mean Squared Error (MSE) Calculator

This mean squared error (MSE) calculator scores predictions against actual values. Enter both lists to get MSE, RMSE, MAE, MAPE, mean error (bias) and R² side by side, with the working shown.

Checks on your data

  • Only 7 points. Error measures from so few cases can change a lot with a single new observation.
  • These measures depend on the scale of your data. Compare them only between models on the same data, or divide by the mean (shown as RMSE ÷ mean) for a relative sense.

Results

Mean squared error (MSE)
1.071429
Root mean squared error (RMSE)
1.0351
same units as your data
Mean absolute error (MAE)
1
Mean error (bias)
-0.14286
model over-predicts on average
MAPE
6.0078 %
RMSE ÷ mean of actual
6.14 %
scale-free comparison
R²
0.89706
Count (n)
7
Actual vs predicted by observation
010201234567ActualPredictedObservation
Metric comparison (MAE ≤ RMSE always; a big gap means a few large misses)
00.51MAE: 1MAE1RMSE: 1.0351RMSE1.04
Error table
ActualPredictedErrorSquared error
121111
1516-11
1413.50.50.25
1819-11
2018.51.52.25
1718-11
2223-11
Show step-by-step solution
  1. Subtract: error = actual − predicted, for each pair.
  2. Square each error and add them: Σe² = 7.5.
  3. MSE = Σe² ÷ n = 7.5 ÷ 7 = 1.071429.
  4. RMSE = √1.071429 = 1.0351.
FormulaMSE = Σ(y − ŷ)² / n
RMSE√MSE, in data units
Lower is betterYes, 0 is perfect
PenalisesLarge errors heavily

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

  1. Enter the observed values and the predictions in the same order.
  2. Read MSE and RMSE for overall accuracy and compare RMSE with MAE.
  3. Check the bias: a non-zero mean error means predictions are systematically high or low.
  4. Use the chart and error table to find the observations that cause the largest errors.

Mean Squared Error Formula

Mean squared error

MSE=1n∑i=1n(yi−y^i)2MSE=\frac{1}{n}\sum_{i=1}^{n}(y_i-\hat{y}_i)^2

Root mean squared error

RMSE=MSERMSE=\sqrt{MSE}

Mean absolute error

MAE=1n∑∣yi−y^i∣MAE=\frac{1}{n}\sum|y_i-\hat{y}_i|

Mean absolute percentage error

MAPE=100%n∑∣yi−y^iyi∣MAPE=\frac{100\%}{n}\sum\left|\frac{y_i-\hat{y}_i}{y_i}\right|

Mean Squared Error Variables Explained

SymbolMeaningNotes
MSEMean squared errorΣ (yᵢ − ŷᵢ)² ÷ n
RMSERoot mean squared error√MSE
MAEMean absolute errorΣ |yᵢ − ŷᵢ| ÷ n
yᵢ, ŷᵢActual and predicted values
nNumber of pairs

Mean Squared Error Worked Example

Using the example values (press “Load example” above to try them):

  1. Subtract: error = actual − predicted, for each pair.
  2. Square each error and add them: Σe² = 7.5.
  3. MSE = Σe² ÷ n = 7.5 ÷ 7 = 1.071429.
  4. 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.

Error metrics compared
MetricUnitsOutlier sensitivityUse it when
MSESquared unitsVery highTraining a model, theory
RMSEData unitsHighLarge errors are especially costly
MAEData unitsLowYou want a typical miss, robust to outliers
MAPEPercentModerateComparing across scales (actuals must not be 0)
R²NoneHighShare 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.

Related calculators

Last updated 2026-11-09. See our disclaimer.