MSE Calculator

Mean squared error between actual and predicted values.

FreeNo accountOn your device

Runs in your browser. How to verify

Loading tool…

About this tool

Enter actual and predicted values and get the mean squared error: the average of the squared differences. Squaring makes every error positive and punishes large errors more than small ones. Units are the square of your data's units.

How to use

1
Step 1
Enter the actual values.
2
Step 2
Enter the predicted values in the same order.
3
Step 3
Press Calculate.

How it works

MSE = (1/n) Σ (yᵢ − ŷᵢ)². It is the loss minimised by ordinary least-squares regression and is smooth, which makes it convenient for gradient descent. Take the square root (RMSE) to get back to the original units.

MSE = (1/n) · Σ (yᵢ − ŷᵢ)²

Worked example

Four predictions

Input
Actual: 3, 5, 2.5, 7 Predicted: 2.5, 5, 4, 8
Output
MSE 0.875 (n = 4)
Walkthrough
The squared errors are 0.25, 0, 2.25 and 1, which sum to 3.5. 3.5 / 4 = 0.875.

Limitations

  • Same-length lists are required.
  • Dominated by large errors, so a single outlier can inflate it.
  • Hard to interpret directly because the units are squared.

Questions

How do I calculate MSE?
Square each error, add them up and divide by the number of values.
What is the difference between MSE and RMSE?
RMSE is the square root of MSE, so it is in the original units.
Why square the errors?
It removes the sign and emphasises large errors.
Can MSE be zero?
Yes, if every prediction is exact.

Features

  • Squared-error loss
  • Runs in your browser
  • Equal-length check

Related resources

Guides and videos from around the web—opens on YouTube or the publisher’s site.

  • Vectors | Essence of linear algebra

    3Blue1Brown

    Embeddings and vectors start with linear algebra intuition.

    Watch on YouTube
  • Finding mean, median, and mode

    Khan Academy

    Baseline stats for accuracy and evaluation helpers.

    Watch on YouTube