Mean Absolute Error Calculator (MAE)

Mean Absolute Error Calculator (MAE)

Emerging AI Skill PRO

Enter Calculation

Comma or space separated numbers
Must have the same count as actual values

Formula

MAE=1n∑i=1n|yi−y^i|\text{MAE} = \frac{1}{n}\sum_{i=1}^{n}\left| {y_i} - {{\hat{y}_i}} \right|
Usage stats

Advertisement

Results

Mean Absolute Error (MAE)
0.875
average absolute deviation
Sum of absolute errors 3.5
Number of pairs (n) 4

Report an error on this page

What Is Mean Absolute Error (MAE)?

The Mean Absolute Error (MAE) is one of the most common metrics used to evaluate the accuracy of a regression model or forecast. It measures the average magnitude of the errors between predicted values and actual observed values, without considering their direction. Because it uses absolute values, every error contributes positively to the total, making MAE easy to interpret: it is the average amount by which your predictions are wrong, expressed in the same units as the data.

Scatter plot with regression line showing vertical distance between actual points and predicted values
MAE measures the average absolute vertical distance between actual data points and predicted values.

How to Use This Calculator

Enter your list of actual (observed) values and your list of predicted (forecast or model) values in the two boxes. Separate each number with a comma or a space. Make sure both lists contain the same number of values, lined up so that the first actual matches the first prediction, and so on. Click calculate to get the MAE along with the sum of absolute errors and the number of paired observations used.

The Formula Explained

The formula is $$\text{MAE} = \frac{1}{n}\sum_{i=1}^{n}\left| y_i - \hat{y}_i \right|$$ For each observation you subtract the predicted value (\(\hat{y}_i\)) from the actual value (\(y_i\)), take the absolute value of that difference (ignoring the minus sign), add all of these absolute differences together, and finally divide by \(n\), the number of observations. The result is the typical size of a single prediction error.

Advertisement
Diagram showing absolute error as the unsigned gap between actual and predicted values on a number line
Each term takes the absolute difference between actual and predicted, so errors never cancel out.

Worked Example

Suppose the actual values are 3, 5, 2, 7 and the predicted values are 2.5, 5, 4, 8. The absolute errors are \(|3-2.5| = 0.5\), \(|5-5| = 0\), \(|2-4| = 2\), and \(|7-8| = 1\). Their sum is 3.5. Dividing by \(n = 4\) gives $$\text{MAE} = 3.5 / 4 = 0.875$$

Interpreting Your MAE Result

MAE is the average size of the forecast errors, ignoring direction. It is expressed in the same units as your data. An MAE of 5 on a series measured in kilograms means predictions miss by about 5 kg on average. The same value of 5 on a series measured in tonnes means something completely different.

Give the number context. A raw MAE is hard to judge on its own, so compare it with one of these:

  • The mean or range of the actual values. An MAE of 2 is small when actuals average 1,000, but large when they average 5.
  • A naive baseline forecast. Examples are \(\hat{y}_t = y_{t-1}\) (the last value) or the mean of the actuals. If your model's MAE is not clearly lower than the baseline's, it adds little value.
  • A scale-relative version. A common one is \(\text{MAE} / \bar{y}\), the MAE divided by the mean of the actual values, often shown as a percentage. It is only meaningful when the mean is well away from zero.

MAE is not scale-free. You cannot compare an MAE in dollars with one in degrees. You also cannot compare MAE across datasets with different units or magnitudes, unless you first normalise it (for example by the mean, or by the MAE of a naive baseline).

MAE versus RMSE. For the same set of errors, MAE is never larger than RMSE:

$$\text{MAE} \le \text{RMSE}$$

They are equal only when every error has the same absolute size. A large gap between RMSE and MAE signals that a few large errors dominate. A small gap means the errors are fairly uniform.

Robustness. MAE weights every error linearly: an error of 10 counts exactly twice as much as an error of 5. It is therefore less sensitive to outliers than squared-error metrics, which is useful when occasional extreme values should not dominate the score. If large misses are especially costly, RMSE may be the better metric to watch alongside MAE.

Advertisement

MAE vs. RMSE vs. MSE: Comparison on Sample Data

All three scenarios use the same actual values: 10, 20, 30, 40 (n = 4). Only the predictions change. Scenarios 1 and 2 have the same total absolute error of 8, so their MAE is identical.

Scenario Predicted Errors (y − ŷ) MAE MSE RMSE
1. Small uniform errors 12, 18, 32, 38 −2, 2, −2, 2 (2+2+2+2)/4 = 2 (4+4+4+4)/4 = 4 √4 = 2
2. One large error 10, 20, 30, 32 0, 0, 0, 8 (0+0+0+8)/4 = 2 (0+0+0+64)/4 = 16 √16 = 4
3. Perfect predictions 10, 20, 30, 40 0, 0, 0, 0 0/4 = 0 0/4 = 0 √0 = 0

What the table shows:

  • Scenarios 1 and 2 both have MAE = 2, because MAE depends only on the total absolute error (8) divided by n (4).
  • Concentrating that same error in one point raises MSE from 4 to 16 and RMSE from 2 to 4, because squaring penalises the single error of 8 heavily: \(8^2 = 64\) versus \(4 \times 2^2 = 16\).
  • In scenario 1, RMSE equals MAE because all errors have the same size. In scenario 2, RMSE is twice MAE, which signals a few large errors.
  • In scenario 3, all three metrics are 0, the best possible value.

FAQ

How is MAE different from MSE? MAE averages absolute errors, while Mean Squared Error (MSE) averages squared errors. MSE penalizes large errors more heavily, whereas MAE treats all errors proportionally.

What is a good MAE value? Lower is better, and \(\text{MAE} = 0\) means perfect predictions. There is no universal threshold — interpret it relative to the scale and typical range of your data.

Can MAE be negative? No. Because it averages absolute (always non-negative) differences, MAE is always zero or positive.

Last updated:

Most popular in Math and Statistics

View all Math and Statistics calculators