Free tool · browser-only calculation

MSE, RMSE, MAE, Huber and R² calculator

Calculate regression losses, residuals and R² from paired actual and predicted values, with an adjustable Huber parameter. With guided examples and shareable.

How the calculation works

MSE⁡=1n∑i(y^i−yi)2,MAE⁡=1n∑i∣y^i−yi∣\operatorname{MSE}=\frac1n\sum_i(\hat y_i-y_i)^2,\quad \operatorname{MAE}=\frac1n\sum_i|\hat y_i-y_i|
Formula as plain text\operatorname{MSE}=\frac1n\sum_i(\hat y_i-y_i)^2,\quad \operatorname{MAE}=\frac1n\sum_i|\hat y_i-y_i|

MSE squares residuals and penalises large errors more strongly; RMSE restores the target unit. MAE uses absolute error and is less sensitive to outliers.

Huber loss combines a quadratic region near zero with linear growth beyond delta. R² compares squared error with actual-value variance and can be negative when a model performs worse than the mean.

Values are processed only in the browser. The residual table exposes every calculation and shows which observations contribute most to the metrics.