Written and maintained by CASRAI Editorial Board
Last updated
Root mean square error (RMSE), also called root mean square deviation or root mean square difference (RMSD) in some fields, is the square root of the average squared difference between predicted and observed values. It is expressed in the same units as the quantity being predicted, so an RMSE of 1.18 mg/L means a typical prediction misses by roughly one mg/L, with large misses weighted more heavily than small ones. This page gives the formula, a fully worked example, how RMSE differs from MSE, MAE and R², how to report it, and tested Excel, R and Python code.
What is RMSE? (RMSE meaning, RMS deviation, root MSE)
RMSE measures the typical size of the errors a model, instrument or forecast makes against known reference values. Each error (prediction minus observation) is squared so that positive and negative errors cannot cancel, the squares are averaged, and the square root returns the result to the original unit. “Root MSE”, “RMSE”, “root mean squared error” and “root mean square deviation” all describe this calculation; “RMS deviation” is the usual wording in physics and chemistry, where the reference values may be a fitted structure or a mean rather than model predictions. A lower RMSE is better, and 0 means every prediction matched exactly. In software this convention is explicit: scikit-learn’s root_mean_squared_error returns a non-negative value where the best score is 0.0, and its scorers treat _error metrics as quantities to minimise.
RMSE formula and every symbol
RMSE = √( (1/n) × Σ (ŷi − yi)² )
- n: the number of paired observations.
- yi: the observed (true) value for case i.
- ŷi: the predicted value for case i.
- Σ: the sum over all n cases.
- The quantity inside the root, (1/n) Σ (ŷi − yi)², is the mean squared error (MSE), so RMSE = √MSE. The “mean root square” and “root mean square calculation” search phrasings refer to this same sequence: square, mean, root.
Reversing the order of subtraction does not change the result, because the difference is squared.
How to calculate RMSE: worked example
These five values are illustrative numbers invented for this example, not data from a study. Suppose a calibration model predicts analyte concentration (mg/L) for five samples with known reference values.
| Sample | Observed y (mg/L) | Predicted ŷ (mg/L) | Error ŷ − y | Squared error | Absolute error |
|---|---|---|---|---|---|
| 1 | 12 | 13 | 1 | 1 | 1 |
| 2 | 15 | 14 | −1 | 1 | 1 |
| 3 | 11 | 11 | 0 | 0 | 0 |
| 4 | 18 | 16 | −2 | 4 | 2 |
| 5 | 14 | 15 | 1 | 1 | 1 |
| Sum | −1 | 7 | 5 |
- Sum of squared errors = 1 + 1 + 0 + 4 + 1 = 7.
- MSE = 7 / 5 = 1.4 (units: mg/L squared).
- RMSE = √1.4 = 1.183 mg/L.
- For comparison, the mean absolute error (MAE) = 5 / 5 = 1.0 mg/L.
Now change sample 4 so the model predicts 12 instead of 16. Its error becomes −6 and the squared errors sum to 1 + 1 + 0 + 36 + 1 = 39, so MSE = 7.8 and RMSE = 2.793 mg/L. MAE rises only from 1.0 to 1.8 (9 / 5). One large miss more than doubled RMSE while MAE less than doubled, which is the practical meaning of “RMSE penalises large errors more”.
What is the unit of mean square error and RMSE?
MSE is in the squared unit of the variable (mg/L squared above), which is hard to interpret. Taking the square root returns RMSE to the original unit (mg/L). This is the main reason analysts report RMSE rather than MSE. It also means RMSE cannot be compared across targets measured in different units or scales without further normalisation.
What is the difference between MSE and RMSE?
RMSE is the square root of MSE. They rank models identically, because the square root is monotonic, so choosing the model with the lowest MSE or the lowest RMSE gives the same answer. They differ in interpretability: RMSE shares the unit of the data, MSE does not. MSE is the quantity most training procedures minimise and decompose; see sum of squares (SST, SSR and SSE) for how it relates to regression output.
What does the RMSE value tell you? Interpretation
RMSE tells you the typical error magnitude, in the target’s units, with extra weight on large errors. It has no universal “good” threshold: judge it against the spread of the data, the measurement precision that matters for the decision, and a baseline model.
| Comparison | How to read it |
|---|---|
| RMSE against the target’s own standard deviation | A baseline that always predicts the mean has an RMSE equal to the population standard deviation of the target. A model whose RMSE is not clearly below this adds little over predicting the mean. |
| RMSE against MAE on the same data | RMSE is always at least as large as MAE. A large gap signals a few big errors; equal values mean all errors have the same size. |
| Training RMSE against held-out RMSE | A much lower training value suggests overfitting; report the held-out figure as the performance estimate. |
| RMSE against the precision you need | If decisions require error under a stated tolerance, compare RMSE to that tolerance directly, in the same unit. |
RMSE vs MAE vs R²
RMSE vs MAE. MAE averages absolute errors and treats every unit of error equally; RMSE squares first and so emphasises large errors. The literature does not crown either one. Chai and Draxler (2014) wrote that they “do not contend that the RMSE is superior over the MAE”, and argued that RMSE is more appropriate when errors are expected to be Gaussian and that a combination of metrics is often needed. Willmott and Matsuura (2005) had earlier argued that RMSE can be a misleading indicator of average error and that MAE is preferable for that purpose. Hodson (2022) showed that RMSE is the optimal summary for normally distributed errors and MAE for Laplace-distributed errors, and called the choice between them a false dichotomy. In practice, report both when large errors matter.
RMSE vs R². RMSE is an absolute measure of error in data units; R² is a unitless proportion of variance explained relative to a mean-only baseline. A model can have a high R² and still have an RMSE too large for the application, or a modest R² with an acceptable RMSE when the target varies little. Report both, as in a regression table, and prefer RMSE when you need the error in real units.
Assumptions and common mistakes
- Scale dependence. RMSE from different units or targets cannot be compared directly. Dividing by the mean or range (“normalised RMSE”) is used, but normalisers differ between papers, so state yours.
- Outlier sensitivity. One extreme error can dominate, as the worked example shows. Inspect residuals before relying on a single number.
- Evaluating on training data. In-sample RMSE flatters the model. Use a held-out set or cross-validation and say which.
- Different denominators. The formula above divides by n. Regression software may report a residual standard error that divides by the residual degrees of freedom (n minus the number of estimated parameters), which gives a larger value. Check what your software reports before comparing numbers.
- Signed bias is hidden. RMSE mixes systematic error and random scatter. Report the mean error alongside it if bias matters.
- Not an effect size. RMSE describes prediction error, not the strength of a relationship; see effect size for that.
How to report RMSE
Report the value with its unit, the number of cases, and what the errors were computed on. Example wording: “On the held-out test set (n = 5), the model’s RMSE was 1.18 mg/L (MAE = 1.00 mg/L).” State the evaluation scheme (hold-out, k-fold cross-validation), the denominator if it is not n, and any normalisation. Round to the precision of the measurements. This is a clarity convention rather than a rule imposed by a style manual; follow your target journal’s instructions where they specify more.
How to calculate root mean square error in Excel, R and Python
Excel
With observed values in A2:A6 and predicted values in B2:B6:
=SQRT(SUMXMY2(A2:A6, B2:B6) / COUNT(A2:A6))
SUMXMY2 returns the sum of squared differences between the two ranges. For the worked example this returns 1.183.
R
obs <- c(12, 15, 11, 18, 14) pred <- c(13, 14, 11, 16, 15) rmse <- sqrt(mean((pred - obs)^2)) rmse # 1.183216
Python
import numpy as np obs = np.array([12, 15, 11, 18, 14]) pred = np.array([13, 14, 11, 16, 15]) rmse = np.sqrt(np.mean((pred - obs) ** 2)) # 1.1832... # scikit-learn 1.4 or later from sklearn.metrics import root_mean_squared_error root_mean_squared_error(obs, pred) # 1.1832...
root_mean_squared_error was added in scikit-learn 1.4; older versions use mean_squared_error and a square root.
FAQ
How to do root mean square error?
Subtract each observed value from its prediction, square the differences, average the squares, then take the square root. The worked example above shows each step with numbers.
What is the unit of mean square error?
The square of the data’s unit (mg/L squared for concentrations in mg/L). RMSE is in the data’s own unit.
What is the difference between MSE and RMSE?
RMSE = √MSE. Both rank models the same way; RMSE is easier to interpret because it shares the unit of the data.
What does the RMS value tell you?
The typical magnitude of the error, weighted toward large errors. Lower is better and 0 is a perfect fit; judge it against the data’s spread, a baseline and the tolerance your application requires.
Is RMSE the same as standard deviation?
Not in general. RMSE measures spread around the true or reference values; standard deviation measures spread around the sample mean. They coincide only when the predictions are all equal to the mean and the denominators match.
Sources
- Chai, T., & Draxler, R. R. (2014). Root mean square error (RMSE) or mean absolute error (MAE)? Arguments against avoiding RMSE in the literature. Geoscientific Model Development, 7, 1247-1250. https://doi.org/10.5194/gmd-7-1247-2014 (read 2026-11-07).
- Willmott, C. J., & Matsuura, K. (2005). Advantages of the mean absolute error (MAE) over the root mean square error (RMSE) in assessing average model performance. Climate Research, 30, 79-82.
- Hodson, T. O. (2022). Root-mean-square error (RMSE) or mean absolute error (MAE): when to use them or not. Geoscientific Model Development, 15, 5481-5487. https://gmd.copernicus.org/articles/15/5481/2022/ (read 2026-11-07).
- scikit-learn documentation, sklearn.metrics.root_mean_squared_error and Metrics and scoring (read 2026-11-07).
Related: mean absolute deviation (spread around the mean, distinct from the mean absolute error of predictions) and standard error of the mean.







