# Mean Squared Error Calculator (MSE, RMSE, SSE)

URL: https://speedycalculator.com/calculators/statistics/mse/
Last updated: 2026-11-08

> The mean squared error calculator compares observed values with predictions (your own or simply the mean of the data) and returns MSE, RMSE, the sum of squared errors, mean absolute error, bias, MAPE and R², with a table of every error and a chart.

## Inputs

- Predicted values
- Observed values (y)
- Predicted values (ŷ), same order

## Results

- Mean squared error (MSE)
- Root mean squared error (RMSE)
- Sum of squared errors (SSE)
- Mean absolute error (MAE)
- Mean error (bias, observed − predicted)
- Mean absolute percentage error (MAPE)
- R² (share of variance explained)
- Number of values
- Mean of observed values
- Observed and predicted values
- Error table

## Formula

```
Error eᵢ = yᵢ − ŷᵢ · SSE = Σeᵢ² · MSE = SSE ÷ n · RMSE = √MSE · MAE = Σ|eᵢ| ÷ n · R² = 1 − SSE ÷ Σ(yᵢ − ȳ)²
```

## Explanation

The mean squared error is the most common way to score how well a model, a forecast or an estimate matches reality. For every observation you take the error (observed minus predicted), square it, and average the squares. Squaring stops positive and negative errors from cancelling each other out and punishes large misses much more than small ones: an error of 4 counts sixteen times as much as an error of 1.

Because MSE is in squared units (°C², dollars²), people usually also report its square root, the RMSE, which is in the same units as the data and can be read as a "typical" size of error. The sum of squared errors (SSE) is the total before averaging, used in regression and ANOVA. The mean absolute error (MAE) is a gentler alternative that does not square, and the mean error (bias) shows whether predictions are too high or too low on average.

If you have no model yet, choose "the mean of the observed values" as the prediction. Then MSE equals the population variance of the data and RMSE its standard deviation, the baseline any useful model should beat.

### How to use the Mean Squared Error Calculator

- **Predicted values**
- **Observed values (y)**
- **Predicted values (ŷ), same order**

Everything is calculated in your browser, so results appear instantly and nothing you type is sent to a server.

### How it works

Enter the observed values, then either let the calculator predict every value with the mean or type your own predictions in the same order. It computes each error, squares and sums them, divides by n for MSE and takes the square root for RMSE. With custom predictions it also reports R² = 1 − SSE ÷ SST.

### Worked example

A forecaster predicted daily highs of 22, 23, 21, 25, 24 and 26 °C; the observed highs were 21, 24, 19, 26, 23 and 28 °C. The errors are −1, 1, −2, 1, −1 and 2, their squares 1, 1, 4, 1, 1 and 4, so SSE = 12, MSE = 12 ÷ 6 = 2 °C² and RMSE = √2 = 1.41 °C. The mean absolute error is 8 ÷ 6 = 1.33 °C, the bias is 0 (no tendency to over- or under-forecast) and R² = 1 − 12 ÷ 53.5 = 0.776.

### MSE, RMSE or MAE?

MeasureUnitsBest forMSEsquaredModel fitting and comparing least-squares modelsRMSEsame as dataReporting a typical error when large misses matterMAEsame as dataRobust error summary, less affected by outliersMAPEpercentComparing series on different scales (not with zeros)

## Worked example

Inputs: Predicted values: My own predictions; Observed values (y): 21, 24, 19, 26, 23, 28; Predicted values (ŷ), same order: 22, 23, 21, 25, 24, 26.

Results: **Mean squared error (MSE) = 2**; Root mean squared error (RMSE) = 1.414214; Sum of squared errors (SSE) = 12; Mean absolute error (MAE) = 1.333333; Mean error (bias, observed − predicted) = 0; Mean absolute percentage error (MAPE) = 5.799 %.

## Key terms

- **Residual (error)**: The observed value minus the predicted value, yᵢ − ŷᵢ.
- **SSE**: Sum of squared errors, the total squared miss.
- **RMSE**: Root mean squared error, the typical size of an error in the data's own units.
- **Bias**: The average error; positive means predictions are too low on average.

## FAQ

**How do I calculate MSE by hand?**
Subtract each prediction from the observed value, square the differences, add them (that is SSE) and divide by the number of values. For errors −1, 1, −2, 1, −1 and 2, SSE = 12 and MSE = 12 ÷ 6 = 2.

**What is the difference between MSE and RMSE?**
RMSE = √MSE. MSE is in squared units; RMSE is in the original units, so an RMSE of 1.41 °C is easier to explain than an MSE of 2 °C².

**What is a good MSE?**
There is no universal threshold, as it depends on the scale of the data. Compare models on the same data, or compare RMSE with the standard deviation of the observations: a useful model has a much smaller RMSE.

**How do I convert between SSE, MSE and RMSE?**
MSE = SSE ÷ n, RMSE = √MSE and SSE = n × MSE. In regression the residual mean square divides SSE by n − p instead of n.

**Why square the errors instead of taking absolute values?**
Squares are smooth and easy to minimise (least squares) and punish big errors strongly. If outliers should not dominate, use the MAE that is also shown.

**What does MSE equal when the prediction is the mean?**
The population variance of the data. In the example 12, 15, 9, 20, 14, 18, 11, 17 the mean is 14.5, MSE = 12.25 and RMSE = 3.5.

**Can MSE be negative?**
No. It is an average of squares, so it is 0 for perfect predictions and positive otherwise.


## Sources

- [Penn State STAT 462: Applied Regression Analysis](https://online.stat.psu.edu/stat462/)
- [NIST/SEMATECH e-Handbook of Statistical Methods](https://www.itl.nist.gov/div898/handbook/)
- [OpenStax: Introductory Statistics 2e](https://openstax.org/details/books/introductory-statistics-2e)
