MSE Calculator

Calculate MSE, RMSE, MAE, and MAPE for regression models and forecasts. Enter actual and predicted values to evaluate model accuracy.

📉 MSE Calculator — Mean Squared Error
MSE
RMSE
MAE
MAPE
n (observations)

📖 What is Mean Squared Error (MSE)?

Mean Squared Error (MSE) is the most widely used metric for evaluating the accuracy of regression models and forecasts. It measures the average squared difference between the values a model predicts and the values that actually occurred. A perfect model would have an MSE of zero, meaning every prediction exactly matches its corresponding observation.

The reason errors are squared before averaging serves three mathematical purposes. First, squaring makes every error positive so that positive and negative errors cannot cancel each other out the way they would if you simply averaged the raw residuals. Second, squaring disproportionately punishes large errors: a residual of 10 contributes 100 to MSE, while a residual of 2 contributes only 4 - a five-fold size difference becomes a twenty-five-fold contribution difference. This property makes MSE ideal when large prediction errors carry severe real-world consequences (for example, structural engineering tolerances or medical dosage predictions). Third, MSE is mathematically smooth and differentiable everywhere, which makes it the standard loss function for training machine learning models via gradient descent.

MSE is expressed in the squared units of the data. If you are predicting house prices in rupees, MSE is in rupees squared - which is hard to interpret intuitively. This is why practitioners almost always accompany MSE with its square root, the RMSE, which restores the original units.

Alongside MSE, this calculator also computes three companion metrics: RMSE (Root Mean Squared Error), MAE (Mean Absolute Error), and MAPE (Mean Absolute Percentage Error). Each metric has a distinct role in model evaluation, and understanding when to use each one is an essential data science skill. You can use the residual breakdown table below the results to inspect every individual error, which is often more informative than looking at aggregate metrics alone.

📐 Formulas

MSE = (1/n) × ∑(actuali − predictedi)2
n = number of observations
actuali = the true (observed) value for observation i
predictedi = the model's prediction for observation i
residuali = actuali − predictedi
RMSE = √MSE
MAE = (1/n) × ∑|actuali − predictedi|
MAPE = (1/n) × ∑ (|actuali − predictedi| / |actuali|) × 100%

The key difference between the formulas is how they treat the size of individual errors. MSE and RMSE square the residuals - large errors are amplified. MAE uses absolute values - all errors are treated proportionally to their size. MAPE converts each error to a percentage of the actual value - making results interpretable across datasets of different scales.

📚 How to Use This Calculator

Step-by-step guide

1
Enter actual values - type the actual (observed) values separated by commas in the Actual Values field. These are the ground-truth measurements from your dataset.
2
Enter predicted values - type the predicted (model output) values in the same order as the actual values, also comma-separated. Both lists must have exactly the same number of entries.
3
Click Calculate - the calculator instantly computes MSE, RMSE, MAE, and MAPE, and displays a row-by-row residual table showing every individual error.
4
Interpret the results - use RMSE for error in the same units as your data; use MAPE for a scale-free percentage comparison; inspect the residual table to identify which individual observations your model struggled with most.

💡 Example Calculations

Example 1 — Simple regression predictions

Actual = [10, 20, 30, 40, 50]  ·  Predicted = [11, 19, 32, 38, 53]

1
Compute residuals: (10−11)=−1, (20−19)=1, (30−32)=−2, (40−38)=2, (50−53)=−3
2
Square each residual: 1, 1, 4, 4, 9
3
MSE = (1 + 1 + 4 + 4 + 9) / 5 = 19 / 5 = 3.8
4
RMSE = √3.8 ≈ 1.9494  ·  MAE = (1+1+2+2+3)/5 = 1.8  ·  MAPE ≈ 8.1%
MSE = 3.8  ·  RMSE ≈ 1.9494  ·  MAE = 1.8  ·  MAPE ≈ 8.1%
Try this example →

Example 2 — House price predictions (lakhs)

Actual = [45, 60, 35, 80, 55]  ·  Predicted = [48, 58, 37, 75, 57]

1
Residuals: −3, 2, −2, 5, −2. Squared: 9, 4, 4, 25, 4
2
MSE = (9 + 4 + 4 + 25 + 4) / 5 = 46 / 5 = 9.2
3
RMSE = √9.2 ≈ 3.033 lakh  ·  MAE = (3+2+2+5+2)/5 = 2.8 lakh
MSE = 9.2  ·  RMSE ≈ 3.033 lakh  ·  MAE = 2.8 lakh  ·  MAPE ≈ 5.3%
Try this example →

Example 3 — Perfect predictions (MSE = 0)

Actual = [5, 10, 15]  ·  Predicted = [5, 10, 15]

1
All residuals are zero: 5−5=0, 10−10=0, 15−15=0
2
MSE = (0 + 0 + 0) / 3 = 0  ·  RMSE = 0  ·  MAE = 0  ·  MAPE = 0%
A perfect model: MSE = 0, RMSE = 0, MAE = 0, MAPE = 0%
Try this example →

Example 4 — Demand forecasting

Actual = [100, 150, 200, 120, 180]  ·  Predicted = [110, 140, 195, 125, 170]

1
Residuals: −10, 10, 5, −5, 10. Squared errors: 100, 100, 25, 25, 100
2
MSE = (100 + 100 + 25 + 25 + 100) / 5 = 350 / 5 = 70
3
RMSE = √70 ≈ 8.367 units  ·  MAE = (10+10+5+5+10)/5 = 8 units  ·  MAPE ≈ 5.4%
MSE = 70  ·  RMSE ≈ 8.367  ·  MAE = 8  ·  MAPE ≈ 5.4%
Try this example →

❓ Frequently Asked Questions

What is Mean Squared Error (MSE)?+
MSE = (1/n) ∑(actual − predicted)². It is the average of the squared differences between actual and predicted values. Squaring ensures all terms are positive so errors don't cancel, heavily penalises large errors more than small ones, and makes the mathematics convenient for optimization (MSE is differentiable everywhere). Lower MSE means better model accuracy.
What is RMSE and how does it differ from MSE?+
RMSE (Root Mean Squared Error) = √MSE. Since MSE is in squared units (e.g. rupees²), RMSE restores the original units (rupees), making it directly interpretable. If you're predicting house prices and RMSE = £50,000, your model's typical error is around £50,000. RMSE is the most widely reported error metric in regression. MSE is better for mathematical optimization; RMSE is better for human interpretation.
What is MAE and when should I use it instead of MSE?+
MAE (Mean Absolute Error) = (1/n) ∑|actual − predicted|. Unlike MSE, it does not square errors, so large errors are not disproportionately penalised. Use MAE when outliers are present and you don't want them to dominate the metric, when errors of different magnitudes matter equally, or when you need a metric that's easy to explain to non-technical stakeholders. Use MSE/RMSE when large errors are substantially more costly than small ones.
What is MAPE (Mean Absolute Percentage Error)?+
MAPE = (1/n) ∑ |actual − predicted| / |actual| × 100%. It expresses error as a percentage of the actual value, making it scale-independent. A MAPE of 5% means predictions are off by 5% on average. Limitation: MAPE is undefined when actual values are zero and can be biased when actual values are very small. For financial forecasting, MAPE < 10% is generally good; < 5% is excellent.
How do you interpret MSE in practice?+
MSE on its own is hard to interpret because it's in squared units. Common approaches: (1) Take the square root to get RMSE in original units. (2) Compare MSE across different models — lower is always better for the same dataset. (3) Compare RMSE to the standard deviation of the actual values; a ratio below 0.7 indicates a useful model. (4) R² = 1 − MSE/Var(actual) measures how much better your model is versus simply predicting the mean.
What is the relationship between MSE and R-squared?+
R² = 1 − MSE/Var(actual) = 1 − (∑(actual−predicted)²) / (∑(actual−mean)²). A perfect model has R²=1 (MSE=0). A model no better than predicting the mean has R²=0. R² can be negative if the model is worse than predicting the mean. Minimising MSE is mathematically equivalent to maximising R² when the actual values are fixed.
How is MSE used in machine learning?+
MSE is the standard loss function for regression problems in machine learning. During training, the model adjusts its parameters to minimise the MSE on the training set. At evaluation, RMSE and MAE are reported on the test set to assess generalisation. MSE's mathematical properties (differentiable, convex for linear models) make gradient descent optimization straightforward. For neural networks, MSE loss leads to learning the conditional mean of the target variable.
When should I use MSE vs MAE as a loss function?+
Use MSE when large errors are much more costly than small ones (e.g., predicting safety-critical measurements), you want to ensure outlying data points are fitted well, or you need a smooth differentiable loss function for optimization. Use MAE when outliers are present and you don't want the model to overfit them, you want the model to predict the conditional median rather than the mean, or you need robustness to noisy labels in training data.
What are typical good or bad MSE/RMSE values?+
There are no universal thresholds because MSE depends entirely on the scale and units of your data. Relative benchmarks: compare RMSE to the target variable's standard deviation (RMSE/SD < 0.7 means the model is useful; < 0.3 is good; > 1.0 means the model is worse than or equal to simply predicting the mean). For forecasting, MAPE < 10% is good; < 5% is excellent. Always compare against a baseline model.
What are residuals and how do they relate to MSE?+
A residual = actual − predicted for each individual observation. MSE is the average of the squared residuals. Examining individual residuals reveals whether errors are random or systematic. Residuals should be randomly scattered around zero with no pattern. If residuals grow larger for larger predicted values (heteroscedasticity) or follow a curve, your model has a structural problem that aggregate metrics like MSE alone will not reveal. The residual table in this calculator makes it easy to spot such patterns.