{
  "id": "mape",
  "version": "b1e30867c1f7",
  "status": "published",
  "name": "MAPE Calculator",
  "question": "What is the MAPE?",
  "summary": "Computes the mean absolute percentage error (MAPE) of a forecast from lists of actual and forecast values, with the mean absolute error (MAE), the root mean squared error (RMSE) and the error of each period.",
  "category": "statistics",
  "subcategory": "descriptive",
  "url": "https://www.acalculator.org/statistics/mape-calculator",
  "markdown": "https://www.acalculator.org/statistics/mape-calculator.md",
  "kind": "schedule",
  "method": "e = actual − forecast; p = 100 × e ÷ actual; MAPE = mean of |p|; MAE = mean of |e|; RMSE = √(mean of e²), over all periods.",
  "assumptions": [
    "The two lists are in the same order: the nth forecast is for the nth actual value.",
    "No actual value is 0; a percentage error divides by it.",
    "Every period counts equally."
  ],
  "inputs": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "actual": {
        "title": "Actual values",
        "description": "The observed values, in time order, separated by commas, spaces or new lines. None may be 0.",
        "type": "array",
        "items": {
          "type": "number"
        }
      },
      "forecast": {
        "title": "Forecast values",
        "description": "The forecast for each period, in the same order as the actual values.",
        "type": "array",
        "items": {
          "type": "number"
        }
      }
    }
  },
  "outputs": {
    "mape": {
      "label": "MAPE",
      "description": "The mean of each period’s |actual − forecast| ÷ |actual| × 100.",
      "format": "percent"
    },
    "mae": {
      "label": "MAE (mean absolute error)",
      "description": "The mean of |actual − forecast|, in the units of the data.",
      "format": "number"
    },
    "rmse": {
      "label": "RMSE (root mean squared error)",
      "description": "The square root of the mean of (actual − forecast)².",
      "format": "number"
    },
    "n": {
      "label": "Periods",
      "description": "How many actual and forecast pairs there are.",
      "format": "integer"
    }
  },
  "defaultAnswer": {
    "inputs": {
      "actual": "100, 200, 150, 250",
      "forecast": "110, 190, 165, 225"
    },
    "outputs": {
      "mape": 8.75,
      "mae": 15,
      "rmse": 16.20185174601965,
      "n": 4
    },
    "text": "The forecasts have a MAPE of 8.75%, with an MAE of 15 and an RMSE of 16.201852."
  },
  "examples": [
    {
      "given": {
        "actual": [
          100,
          200,
          150,
          250
        ],
        "forecast": [
          110,
          190,
          165,
          225
        ]
      },
      "expect": {
        "mape": 8.75,
        "mae": 15,
        "rmse": 16.20185174601965,
        "n": 4
      },
      "source": "Hyndman, R.J., & Athanasopoulos, G. (2021) Forecasting: principles and practice, 3rd edition, OTexts, §5.8 Evaluating point forecast accuracy (e = y − ŷ; p = 100e ÷ y; MAPE = mean(|p|); MAE = mean(|e|); RMSE = √mean(e²)). https://otexts.com/fpp3/accuracy.html; hand calculation in content.mdx: errors −10, 10, −15, 25; percentage errors 10, 5, 10, 10; MAPE = 35 ÷ 4 = 8.75; MAE = 60 ÷ 4 = 15; RMSE = √(1,050 ÷ 4)"
    },
    {
      "given": {
        "actual": [
          10,
          20,
          30
        ],
        "forecast": [
          10,
          20,
          30
        ]
      },
      "expect": {
        "mape": 0,
        "mae": 0,
        "rmse": 0
      },
      "source": "Hyndman, R.J., & Athanasopoulos, G. (2021) Forecasting: principles and practice, 3rd edition, OTexts, §5.8 Evaluating point forecast accuracy (e = y − ŷ; p = 100e ÷ y; MAPE = mean(|p|); MAE = mean(|e|); RMSE = √mean(e²)). https://otexts.com/fpp3/accuracy.html; hand calculation in content.mdx: every error is 0"
    },
    {
      "given": {
        "actual": "-50, 100",
        "forecast": "-40, 90"
      },
      "expect": {
        "mape": 15,
        "mae": 10,
        "rmse": 10
      },
      "source": "Hyndman, R.J., & Athanasopoulos, G. (2021) Forecasting: principles and practice, 3rd edition, OTexts, §5.8 Evaluating point forecast accuracy (e = y − ŷ; p = 100e ÷ y; MAPE = mean(|p|); MAE = mean(|e|); RMSE = √mean(e²)). https://otexts.com/fpp3/accuracy.html; hand calculation in content.mdx: |−10| ÷ |−50| × 100 = 20 and 10 ÷ 100 × 100 = 10; mean 15"
    },
    {
      "given": {
        "actual": [
          0.5,
          0.25
        ],
        "forecast": [
          0.4,
          0.3
        ]
      },
      "expect": {
        "mape": 20,
        "mae": 0.075,
        "rmse": 0.07905694150420949
      },
      "source": "Hyndman, R.J., & Athanasopoulos, G. (2021) Forecasting: principles and practice, 3rd edition, OTexts, §5.8 Evaluating point forecast accuracy (e = y − ŷ; p = 100e ÷ y; MAPE = mean(|p|); MAE = mean(|e|); RMSE = √mean(e²)). https://otexts.com/fpp3/accuracy.html; hand calculation in content.mdx: 0.1 ÷ 0.5 × 100 = 20 and 0.05 ÷ 0.25 × 100 = 20; RMSE = √0.00625"
    }
  ],
  "sources": [
    "Hyndman, R.J., & Athanasopoulos, G. (2021) Forecasting: principles and practice, 3rd edition, OTexts, §5.8 Evaluating point forecast accuracy: forecast error e = y − ŷ, percentage error p = 100e ÷ y, MAPE = mean(|p|), MAE = mean(|e|), RMSE = √mean(e²); percentage errors are undefined when y = 0 and put a heavier penalty on negative errors. https://otexts.com/fpp3/accuracy.html (retrieved 2026-10-18)"
  ],
  "related": [
    "mean-absolute-deviation",
    "residual",
    "percent-error",
    "standard-deviation"
  ],
  "changelog": []
}
