Root Mean Square Error Calculator

Root Mean Square Error Calculator

Growing AI Skill PRO

Enter Calculation

Formula

RMSE=1n∑i=1n(Actuali−Predictedi)2\text{RMSE} = \sqrt{\frac{1}{n} \sum_{i=1}^{n} \left( {{\text{Actual}_i}} - {{\text{Predicted}_i}} \right)^2}
Usage stats

Advertisement

Results

Root Mean Square Error
0.6124
RMSE
Data points (n) 4
Mean Squared Error (MSE) 0.375
Mean Absolute Error (MAE) 0.5

Report an error on this page

What Is Root Mean Square Error (RMSE)?

Root Mean Square Error (RMSE) is one of the most widely used metrics for measuring how far a model's predictions deviate from the observed (actual) values. It expresses the typical size of the prediction error in the same units as the data, which makes it easy to interpret. A lower RMSE means a better fit, and an RMSE of zero means the predictions are perfect.

Scatter plot of data points with a regression line and vertical residual segments between points and line
RMSE summarizes the residuals — the vertical gaps between actual points and predicted values.

How to Use This Calculator

Enter your actual values and your predicted values as two lists, separated by commas or spaces. The two lists should have the same number of entries; if they differ, the calculator uses the first n matching pairs. Click calculate to see the RMSE, along with the Mean Squared Error (MSE) and Mean Absolute Error (MAE) for additional context.

The Formula Explained

RMSE is computed in four steps: (1) subtract each predicted value from its actual value to get the error, (2) square each error so positive and negative values do not cancel, (3) average those squared errors to get the MSE, and (4) take the square root to return to the original units. Squaring gives larger errors more weight, so RMSE is sensitive to outliers compared with MAE.

$$\text{RMSE} = \sqrt{\frac{1}{n} \sum_{i=1}^{n} \left( \text{Actual}_i - \text{Predicted}_i \right)^2}$$
Advertisement
Flat diagram showing the steps of the RMSE formula from errors to squaring to averaging to square root
Each error is squared, averaged, then square-rooted to return the result to original units.

Worked Example

Suppose actual = [3, -0.5, 2, 7] and predicted = [2.5, 0.0, 2, 8]. The errors are 0.5, -0.5, 0, -1. Squared: 0.25, 0.25, 0, 1, which sum to 1.5. Dividing by \(n = 4\) gives \(\text{MSE} = 0.375\). The square root gives \(\text{RMSE} \approx 0.6124\). The MAE is $$\text{MAE} = \frac{0.5 + 0.5 + 0 + 1}{4} = 0.5.$$

Advertisement

More Worked Examples

Both examples use temperature forecasts in °C over five days. Each error is \(e_i = \text{Actual}_i - \text{Predicted}_i\). The squared errors give MSE and RMSE, and the absolute errors give MAE. The two data sets are the same except for day 5, so you can see what one large miss does to each metric.

Example 1: A Reasonably Accurate Forecast

Actual temperatures: 20, 22, 25, 24, 21. Predicted temperatures: 21, 20, 25, 27, 22.

Day Actual (°C) Predicted (°C) Error \(e_i\) Squared error \(e_i^2\) Absolute error \(|e_i|\)
1 20 21 −1 1 1
2 22 20 2 4 2
3 25 25 0 0 0
4 24 27 −3 9 3
5 21 22 −1 1 1
Sum 15 7
  1. Sum of squared errors: \(1 + 4 + 0 + 9 + 1 = 15\)
  2. MSE: $$\text{MSE} = \frac{15}{5} = 3$$
  3. RMSE: $$\text{RMSE} = \sqrt{3} \approx 1.7321$$
  4. MAE: $$\text{MAE} = \frac{1 + 2 + 0 + 3 + 1}{5} = \frac{7}{5} = 1.4$$

Result: RMSE ≈ 1.7321 °C and MAE = 1.4 °C. The two values are close (RMSE/MAE ≈ 1.24) because all the errors are about the same size.

Example 2: The Same Forecast With One Large Miss

Everything stays the same except day 5, where the forecast was 31 °C instead of 22 °C. The actual temperature was still 21 °C.

Day Actual (°C) Predicted (°C) Error \(e_i\) Squared error \(e_i^2\) Absolute error \(|e_i|\)
1 20 21 −1 1 1
2 22 20 2 4 2
3 25 25 0 0 0
4 24 27 −3 9 3
5 21 31 −10 100 10
Sum 114 16
  1. Sum of squared errors: \(1 + 4 + 0 + 9 + 100 = 114\)
  2. MSE: $$\text{MSE} = \frac{114}{5} = 22.8$$
  3. RMSE: $$\text{RMSE} = \sqrt{22.8} \approx 4.7749$$
  4. MAE: $$\text{MAE} = \frac{1 + 2 + 0 + 3 + 10}{5} = \frac{16}{5} = 3.2$$

Result: RMSE ≈ 4.7749 °C and MAE = 3.2 °C.

Comparing the Two Examples

Metric Example 1 Example 2 Increase
MSE (°C²) 3 22.8 ×7.6
RMSE (°C) 1.7321 4.7749 +3.0428 (×2.76)
MAE (°C) 1.4 3.2 +1.8 (×2.29)
RMSE ÷ MAE 1.24 1.49 —

A single forecast that was 10 °C off made up 100 of the 114 total squared error, or about 88%. MAE counts that miss as 10 out of 16 total error units. Because RMSE squares each error before averaging, it went up much more than MAE did. When RMSE is much larger than MAE, a few large errors are usually driving the score. Look at those individual points before deciding whether the whole model is bad.

Units: RMSE and MAE are in °C, the same unit as the data. MSE is in °C², which is why RMSE is often easier to interpret.

FAQ

What is a good RMSE value? It depends entirely on the scale of your data. Compare RMSE to the range or mean of your target variable, or against a baseline model.

How is RMSE different from MAE? RMSE squares errors before averaging, so it penalizes large errors more heavily, while MAE treats all errors proportionally.

Can RMSE be negative? No. Because it is the square root of an average of squares, RMSE is always zero or positive.

Last updated:

Most popular in Math and Statistics

View all Math and Statistics calculators