Skip to main content

MSE, RMSE, MAE, MAPE & R-squared Calculator

Computes MSE, RMSE, MAE, MAPE and R-squared from paired actual and predicted values, with a residual table.

For checking a regression or forecasting model's error by hand or against a library.

Last updatedHow we build & check our tools
Results will appear here once you enter your values.

What each metric means

With n pairs, residual rᵢ = actualᵢ − predictedᵢ.

  • MSE = mean of rᵢ². Units are the target's units squared.
  • RMSE = square root of MSE. Same units as the target.
  • MAE = mean of |rᵢ|. Same units as the target, less sensitive to outliers than RMSE.
  • MAPE = mean of |rᵢ| / |actualᵢ| × 100 over nonzero actuals only.
  • R² = 1 − Σrᵢ² / Σ(actualᵢ − mean actual)².

The definitions follow the scikit-learn metrics documentation, with the MAPE zero handling noted above.

Worked example with the default inputs

Actual: 3, 5, 2.5, 7. Predicted: 2.8, 5.4, 3, 6.5. Residuals are 0.2, −0.4, −0.5 and 0.5.

  • MSE: (0.04 + 0.16 + 0.25 + 0.25) / 4 = 0.175.
  • RMSE: square root of 0.175 = 0.41833.
  • MAE: (0.2 + 0.4 + 0.5 + 0.5) / 4 = 0.4.
  • MAPE: 10.452%, averaging 6.67%, 8%, 20% and 7.14%.
  • R²: the mean of the actuals is 4.375 and the total sum of squares is 12.6875, so R² = 1 − 0.7 / 12.6875 = 0.94483.

Limits and sources

  • Not a validation: results describe only the pairs you enter, with no confidence intervals or significance tests.
  • MAPE is lopsided: it penalises over-prediction more than under-prediction and explodes for actuals near zero. Consider MAE or RMSE if your data includes small values.
  • R² is not accuracy: a high R² on training data can coexist with a poor model on new data.

Sources: scikit-learn documentation for mean_squared_error, root_mean_squared_error, mean_absolute_error, mean_absolute_percentage_error and r2_score.

Frequently Asked Questions

Common questions about the MSE, RMSE, MAE, MAPE & R-squared Calculator

All three average the size of the residuals (actual minus predicted). MSE squares them, so large misses dominate and the unit is squared. RMSE is its square root, back in the original units. MAE averages absolute values, treating every unit of error equally. If RMSE is much larger than MAE, a few large errors are driving the result.

From the same team

Stop paying per token — route AI requests to your own GPU

Wide Area AI is a local-first AI gateway: repeated requests hit an edge cache, the rest run free on your own hardware, and the cloud is only a failover. OpenAI-compatible endpoint, free tier.

Start routing — free

Explore More Tools

Explore these related tools for your next step.

ai
ai
ai
ai
ai
ai