{
  "id": "coefficient-of-variation",
  "version": "5e30e6c3e761",
  "status": "published",
  "name": "Coefficient of Variation Calculator",
  "question": "What is the coefficient of variation?",
  "summary": "Computes the coefficient of variation (CV) of a list of numbers, the sample or population standard deviation divided by the mean, as a percent and a ratio.",
  "category": "statistics",
  "subcategory": "descriptive",
  "url": "https://www.acalculator.org/statistics/coefficient-of-variation-calculator",
  "markdown": "https://www.acalculator.org/statistics/coefficient-of-variation-calculator.md",
  "kind": "function",
  "method": "CV = s ÷ x̄, shown as 100 × s ÷ x̄ percent; s is the sample (n − 1) or population (N) standard deviation.",
  "assumptions": [
    "The CV is meaningful for data on a ratio scale (a true zero), such as lengths, weights or times.",
    "The CV is not defined when the mean is 0; near 0 it changes a lot with small changes in the data.",
    "A negative mean gives a negative CV; the relative standard deviation uses the size of the mean instead."
  ],
  "inputs": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "x": {
        "title": "Data values",
        "description": "The numbers, separated by commas, spaces, semicolons, or new lines.",
        "type": "array",
        "items": {
          "type": "number"
        }
      },
      "type": {
        "title": "Data are a",
        "description": "Sample: the standard deviation divides by n − 1. Population: every member is listed, so it divides by N.",
        "type": "string",
        "enum": [
          "sample",
          "population"
        ]
      }
    }
  },
  "outputs": {
    "percent": {
      "label": "Coefficient of variation (CV)",
      "description": "The standard deviation as a percent of the mean: 100 × s ÷ x̄ (negative when the mean is).",
      "format": "percent"
    },
    "rsd": {
      "label": "Relative standard deviation (RSD)",
      "description": "The standard deviation as a percent of the size of the mean: 100 × s ÷ |x̄|.",
      "format": "percent"
    },
    "cv": {
      "label": "CV as a ratio",
      "description": "s ÷ x̄, not multiplied by 100.",
      "format": "number"
    },
    "mean": {
      "label": "Mean (x̄)",
      "description": "The sum of the values divided by their count.",
      "format": "number"
    },
    "sd": {
      "label": "Standard deviation (s)",
      "description": "The sample (n − 1) or population (N) standard deviation, as chosen.",
      "format": "number"
    },
    "n": {
      "label": "Count (n)",
      "description": "How many values there are.",
      "format": "integer"
    }
  },
  "defaultAnswer": {
    "inputs": {
      "x": "10, 12, 23, 23, 16, 23, 21, 16",
      "type": "sample"
    },
    "outputs": {
      "percent": 29.095718698132316,
      "rsd": 29.095718698132316,
      "cv": 0.29095718698132317,
      "mean": 18,
      "sd": 5.237229365663817,
      "n": 8
    },
    "text": "The coefficient of variation of the 8 values is 29.0957%."
  },
  "examples": [
    {
      "given": {
        "x": [
          10,
          12,
          23,
          23,
          16,
          23,
          21,
          16
        ],
        "type": "sample"
      },
      "expect": {
        "percent": 29.095718698132323,
        "rsd": 29.095718698132323,
        "cv": 0.2909571869813232,
        "mean": 18,
        "sd": 5.237229365663818,
        "n": 8
      },
      "source": "hand calculation in content.mdx: x̄ = 144 ÷ 8 = 18, Σ(x − x̄)² = 192, s = √(192 ÷ 7); NIST Dataplot Reference Manual, COEFFICIENT OF VARIATION (cv = s / x̄; relative standard deviation = 100 s / |x̄|), https://itl.nist.gov/div898/software/dataplot/refman2/auxillar/coefvari.htm (retrieved 2026-10-02); NIST/SEMATECH e-Handbook of Statistical Methods, §1.3.5.6 Measures of Scale (s² = Σ(Y − Ȳ)² ÷ (N − 1)), https://www.itl.nist.gov/div898/handbook/eda/section3/eda356.htm (retrieved 2026-10-02); Python 3: statistics.stdev"
    },
    {
      "given": {
        "x": [
          2,
          4,
          4,
          4,
          5,
          5,
          7,
          9
        ],
        "type": "population"
      },
      "expect": {
        "percent": 40,
        "cv": 0.4,
        "mean": 5,
        "sd": 2
      },
      "source": "hand calculation in content.mdx: x̄ = 40 ÷ 8 = 5, Σ(x − x̄)² = 32, σ = √(32 ÷ 8) = 2, CV = 2 ÷ 5; NIST Dataplot Reference Manual, COEFFICIENT OF VARIATION (cv = s / x̄; relative standard deviation = 100 s / |x̄|), https://itl.nist.gov/div898/software/dataplot/refman2/auxillar/coefvari.htm (retrieved 2026-10-02); Python 3: statistics.pstdev"
    },
    {
      "given": {
        "x": [
          -4,
          -6,
          -8
        ],
        "type": "sample"
      },
      "expect": {
        "percent": -33.333333333333336,
        "rsd": 33.333333333333336,
        "mean": -6,
        "sd": 2
      },
      "source": "hand calculation in content.mdx: x̄ = −6, s = √(8 ÷ 2) = 2, CV = 2 ÷ −6; NIST Dataplot Reference Manual, COEFFICIENT OF VARIATION (cv = s / x̄; relative standard deviation = 100 s / |x̄|), https://itl.nist.gov/div898/software/dataplot/refman2/auxillar/coefvari.htm (retrieved 2026-10-02)"
    }
  ],
  "sources": [
    "NIST Dataplot Reference Manual, COEFFICIENT OF VARIATION (the sample coefficient of variation is the ratio of the standard deviation to the mean, cv = s ÷ x̄; used for data on a ratio scale; the relative standard deviation is 100 s ÷ |x̄|). https://itl.nist.gov/div898/software/dataplot/refman2/auxillar/coefvari.htm (retrieved 2026-10-02)",
    "NIST/SEMATECH e-Handbook of Statistical Methods, §1.3.5.6 Measures of Scale (sample variance and standard deviation with N − 1). https://www.itl.nist.gov/div898/handbook/eda/section3/eda356.htm (retrieved 2026-10-02)"
  ],
  "related": [
    "relative-standard-deviation",
    "standard-deviation",
    "variance"
  ],
  "changelog": []
}
