Root mean square error (RMSE) measures how far predicted values are from actual values, expressed in the same units as the data. You enter two lists of numbers (observed and predicted), and the calculator returns the RMSE along with related error metrics like mean absolute error and mean bias.
in obs | Observed values | - | 3, 4, 5, 6, 7 | 0 | 1000000 in pred | Predicted values | - | 2.8, 4.2, 5.1, 5.9, 7.3 | 0 | 1000000 out rmse | RMSE | - | sqrt(mean((obs - pred)^2)) | 4 out mae | Mean Absolute Error | - | mean(abs(obs - pred)) | 4 out bias | Mean Bias (pred - obs) | - | mean(pred - obs) | 4
Formula
RMSE is the square root of the average of the squared differences between predicted and observed values. Written in symbols:
RMSE = √( (1/n) × Σ (pᵢ − oᵢ)² )
- n = number of data points (both lists must have the same length)
- oᵢ = observed (actual) value for the i-th point
- pᵢ = predicted (model) value for the i-th point
The result is in the same unit as the values themselves. If your data are in meters, RMSE is in meters; if in dollars, RMSE is in dollars.
Worked Example
Using the default values: observed = [3, 4, 5, 6, 7], predicted = [2.8, 4.2, 5.1, 5.9, 7.3].
- Compute each difference (pred − obs): −0.2, 0.2, 0.1, −0.1, 0.3
- Square each difference: 0.04, 0.04, 0.01, 0.01, 0.09
- Sum the squares: 0.04 + 0.04 + 0.01 + 0.01 + 0.09 = 0.19
- Divide by n = 5: 0.19 / 5 = 0.038
- Take the square root: √0.038 ≈ 0.1949
The calculator rounds to 4 decimals, giving RMSE = 0.1949. The mean absolute error is (0.2+0.2+0.1+0.1+0.3)/5 = 0.18, and the mean bias is (−0.2+0.2+0.1−0.1+0.3)/5 = 0.06.
Why RMSE Is So Widely Used
RMSE is a standard metric in regression analysis, machine learning, and forecasting. It tells you how concentrated the errors are around zero. Because the errors are squared before averaging, large errors are penalized more heavily than in mean absolute error (MAE). This makes RMSE especially sensitive to outliers—a single bad prediction can inflate RMSE dramatically.
For example, if one prediction is off by 10 units while others are off by 1, the squared error for that point is 100, which dominates the average. This property is desirable when large errors are particularly costly, such as in financial forecasting or engineering safety models.
How to Choose Between RMSE and MAE
Both RMSE and MAE summarize the average error, but they answer slightly different questions:
- RMSE: Gives more weight to large errors. Use it when big mistakes are disproportionately bad.
- MAE: Treats all errors equally. Use it when you want a straightforward average error magnitude.
If your data have outliers, RMSE will be noticeably larger than MAE. If they are nearly equal, your errors are relatively uniform. Comparing the two can reveal whether your model occasionally produces large errors.
Common Mistakes and Pitfalls
One frequent error is mixing up the order of observed and predicted values. RMSE is symmetric—swapping the lists gives the same result—but the mean bias will change sign. Another mistake is forgetting to match list lengths; the calculator will reject mismatched lists.
Units are another trap. If you measure temperature in Celsius but your model outputs Fahrenheit, the RMSE will be meaningless. Always ensure both lists are in the same unit. Also, RMSE is not comparable across datasets with different scales—an RMSE of 5 for house prices in thousands is not the same as 5 for ages in years.
Limitations of RMSE
RMSE is not scale-free, so you cannot compare it across different datasets unless they share the same unit and range. It also assumes that errors are symmetric and that the mean of the errors is zero (no systematic bias). If your model consistently overpredicts, the bias term will be positive, but RMSE alone won't tell you that—you need to check the mean bias.
Additionally, RMSE is sensitive to outliers, which can be a drawback if those outliers are measurement errors rather than meaningful events. In such cases, a robust metric like MAE or median absolute deviation might be more appropriate.
Alternatives to RMSE
Several related metrics offer different perspectives:
- Mean absolute error (MAE): Average absolute difference, less sensitive to outliers.
- Mean squared error (MSE): RMSE squared, in squared units. Often used as a loss function.
- R-squared (R²): Proportion of variance explained, scale-free but not an error magnitude.
- Mean absolute percentage error (MAPE): Error as a percentage, but undefined when observed values are zero.
Each has its place. RMSE is the default choice when you want a single number that reflects typical error magnitude with extra weight on large errors.
Frequently Asked Questions
What is a good RMSE value?
There is no universal threshold. A good RMSE depends on the scale of your data and the context. For example, an RMSE of 2°C in weather forecasting might be excellent, while an RMSE of $2 in stock price prediction could be terrible if the stock trades at $1,000. Compare RMSE to the standard deviation of the observed values—if RMSE is much smaller, your model is doing well.
Can RMSE be negative?
No. RMSE is a square root of a sum of squares, so it is always zero or positive. A value of zero means perfect predictions—every predicted value exactly equals the observed value.
What is the difference between RMSE and standard deviation?
Standard deviation measures the spread of a single variable around its mean. RMSE measures the spread of prediction errors around zero (or around the mean error if you subtract bias). If your model has zero bias, RMSE is essentially the standard deviation of the errors.
How do I interpret RMSE in real-world terms?
RMSE tells you that, on average, your predictions are off by roughly that amount, with larger errors weighted more heavily. For instance, an RMSE of 3.2 kg in a weight prediction model means typical errors are around 3.2 kg, but some errors may be larger.
Does RMSE work for classification problems?
RMSE is designed for regression (continuous values). For classification, you would use accuracy, precision, recall, or log loss. Using RMSE on binary 0/1 outcomes is possible but not standard.