MSE Calculator
Mean squared error between actual and predicted values.
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
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?
What is the difference between MSE and RMSE?
Why square the errors?
Can MSE be zero?
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 YouTubeFinding mean, median, and mode
Khan Academy
Baseline stats for accuracy and evaluation helpers.
Watch on YouTube
- Metrics and scoring
scikit-learn
Precision, recall, F1 definitions used by AI metric tools.
- OpenAI Research
OpenAI
Research notes for people exploring AI tooling trends.