Skip to content
ENExplore Calculators

MSE Calculator

Calculate mean squared error between predicted and actual values.

About MSE Calculator

Mean Squared Error (MSE) is the average of squared prediction errors: MSE = (1/n) × Σ(y_i − ŷ_i)². Squaring the errors penalizes larger deviations disproportionately more than smaller ones, making MSE especially sensitive to outliers. MSE is also mathematically convenient because it's differentiable everywhere, which is why it's the default loss function for training many regression models via gradient descent. Its units are the square of the target variable's units, which is why RMSE (its square root) is often reported instead for easier interpretation.

Formula

MSE = (1/n) * sum((y_i - y_hat_i)^2)

n
Number of samples
y_i
Actual value for sample i
\hat{y}_i
Predicted value for sample i

Worked example

With the default values below, MSE Calculator returns Mean Squared Error of 0.3750. Change any input above and every figure here is recalculated in your browser.

Inputs used

Actual Values
3, -0.5, 2, 7
Predicted Values
2.5, 0.0, 2, 8

Results

Mean Squared Error
0.3750
Number of Samples
4

Step by step

  1. 1Sum of squared errors: Σ(y_i − ŷ_i)²= 1.5000
  2. 2MSE: sum of squared errors / n= 0.3750

Assumptions and limits

  • The result is derived only from the 2 inputs listed above. Anything not among them is not part of the calculation.
  • In particular, this calculator does not take inflation, tax, fees or charges or compounding frequency into account.
  • Figures are rounded for display to 4 decimal places, so totals built from several rounded parts can differ slightly from the unrounded arithmetic.

How these calculators are built and tested is described on the Methodology page. If a figure looks wrong, please report it.

Frequently Asked Questions

Why square the errors instead of using absolute value?

Squaring makes the loss function smooth and differentiable everywhere (unlike absolute value, which has a kink at zero), which is convenient for gradient-based optimization, and it heavily penalizes large errors, which can be desirable when big mistakes are especially costly.

Why is MSE hard to interpret directly?

MSE is in squared units of the target variable, so if you're predicting dollars, MSE is in 'dollars squared', which has no intuitive real-world meaning — RMSE converts this back to the original units by taking the square root.

Is MSE always non-negative?

Yes — since every term is a squared value, MSE is always greater than or equal to zero, with 0 occurring only when every prediction exactly matches its actual value.

MSE Calculator – Calculate Mean Squared Error | Calcrivo