ForHosting KIT · Math

Coefficient of variation calculator

The values 2, 4, 4, 4, 5, 5, 7 and 9 have a mean of 5 and a population standard deviation of 2, so their coefficient of variation is 0.4, or 40 percent. Compare the spread of series measured on different scales. Free in your browser.

  • Free
  • Runs in your browser
  • No sign-up
  • Your data stays on your device
Use it from WebAPIEmailTelegramApp soon

The coefficient of variation (CV) is the standard deviation divided by the mean, a unitless measure of relative spread that lets you compare variability across series with different scales or units. A list with mean 50 and standard deviation 5 has the same CV as a list with mean 500 and standard deviation 50, even though the absolute spreads differ by an order of magnitude.

What the coefficient of variation measures and when to use it

Absolute standard deviation is hard to interpret across datasets that live on different scales. A machine that produces bolts with mean length 10 mm and standard deviation 0.2 mm is far tighter in relative terms than a sensor whose readings average 1000 units with standard deviation 0.2, yet both share the same absolute spread. The coefficient of variation answers that comparison by dividing the standard deviation by the mean, yielding a dimensionless ratio that can also be multiplied by one hundred and reported as a percentage.

Population CV uses the population standard deviation (divide the sum of squared deviations by n, then take the square root) over the arithmetic mean; sample CV uses the sample standard deviation (Bessel correction, divide by n minus one) over the same mean.

Analysts use CV in quality control to compare process variation, in finance to contrast volatility of returns with different average levels, in lab work to report assay precision, and in education to show students why two spreads that look identical on a calculator are not equally tight relative to their centers. Empty lists never produce a mean or a CV either; they fail validation immediately.

Because every step is a finite sum of products of known numbers followed by a square root and a division, the procedure is classical and fully deterministic: the same list always yields the same mean, the same pair of standard deviations, and the same CV ratio and percentage.

How this calculator validates the list and computes CV

After validation the core walks the list once to accumulate the sum and form the mean, rejects a zero mean, then walks again to accumulate the sum of squared deviations from that mean. Population standard deviation is the square root of that sum divided by n; sample standard deviation is the square root of the same sum divided by n minus one when n is at least two, and null when n equals one.

Population CV is population standard deviation divided by the mean; the percentage form multiplies that ratio by one hundred. Sample CV and its percentage follow the same pattern when sample standard deviation is defined. A microscopic clamp prevents floating round-off on a zero-spread list from inventing a negative sum of squares.

Homework and introductory statistics labs

Students and graders verify mean, standard deviation, and coefficient of variation as ratio and percentage, including the hard rule that a zero mean is invalid.

What is the coefficient of variation formula?

CV is the standard deviation divided by the mean. Population CV uses population std (divide sum of squared deviations by n); sample CV uses sample std (divide by n minus one). Both are also returned as percentages (ratio times 100).

Is the coefficient of variation calculator free?

The browser tool runs free on your device.

Why is there no coefficient of variation when the mean is zero?

Because the standard deviation would be divided by zero, which is undefined. The calculator rejects a zero mean, and an empty list, with a clear message instead of showing infinity or a meaningless number.

What is the difference between the population and sample CV?

Both divide a standard deviation by the same mean. The population version divides the sum of squared deviations by n before taking the square root, while the sample version divides by n minus one, so the sample CV comes out slightly larger.

Why compare coefficients of variation instead of standard deviations?

Because the same absolute spread means very different things at different scales. Bolts averaging 10 mm with a standard deviation of 0.2 mm are far tighter than sensor readings averaging 1000 with the same 0.2, and the CV shows that at once.

Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.

POSThttps://api.kit.forhosting.com/stat/coefficient-variation

Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.

curl -X POST https://api.kit.forhosting.com/stat/coefficient-variation \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"values":[2,4,4,4,5,5,7,9]}'
{
  "values": [
    2,
    4,
    4,
    4,
    5,
    5,
    7,
    9
  ]
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "stat.coefficient_variation",
  "status": "queued",
  "_links": {
    "result": "/tasks/tsk_…/result"
  }
}

The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.

Per request$0.002

Published price — no tokens, no invented credits. A failed task is never charged.

max_values100000
HTTPCodeMeaning
401unauthorizedMissing or invalid API key.
402insufficient_balanceYour balance doesn't cover the task price.
404unknown_typeThat task type doesn't exist.
429rate_limitedToo many requests. Use the webhook instead of polling.

This calculator takes a non-empty array of finite numbers, returns the mean, population and sample standard deviations, and the coefficient of variation both as a ratio and as a percentage, and rejects a zero mean or an empty list with a clear invalid_input error so pipelines never invent a silent infinity. The arithmetic is fully deterministic, runs free in your browser, and is available over the API at $0.002 per successful request with no language model and no external statistics service on the hot path.

What the coefficient of variation measures and when to use it

One hard rule is universal: when the mean is zero, division is undefined, so this capability fails with invalid_input rather than inventing infinity or NaN.

How this calculator validates the list and computes CV

Call the capability with a required array field named values: a non-empty list of finite numbers whose mean is not zero. The engine also accepts the aliases numbers, data, list, and x, so scripts that already speak in those terms do not need a rename step. Validation rejects a missing field, a non-array, an empty array, lists longer than the published maximum, any entry that is not a finite number, and a list whose mean is exactly zero, all with invalid_input and without charging balance.

Practical use, limits, pricing, and delivery

Use the browser tool when you want an immediate coefficient of variation while checking a homework answer, comparing relative spread across two series, or explaining why zero-mean data cannot have a defined CV without installing a statistics package. Results are fully deterministic: the same values always yield the same mean, population and sample standard deviations, CV ratios, percentages, and sum of squared deviations. There is no language model, no external statistics service, and no randomness, so the capability is safe to pin in continuous-integration checks and reproducible lesson materials. Each successful request is one billable item at $0.002; failed validation does not consume balance. Accepted lists stay bounded for Worker isolates: up to one hundred thousand values cover classroom tables, sensor batches, and typical analytics excerpts while still finishing quickly. Wire the endpoint into data-science tutorials, spreadsheet-migration tests, coding-interview sandboxes, or preprocessing steps where you already prefer closed-form two-pass CV over approximate streaming sketches or opaque black-box calculators that hide whether they divide by n or by n minus one when they print a single coefficient of variation field.

Quality control and process comparison

Engineers compare relative spread across batches or machines on different absolute scales using a stable population and sample CV in JSON.

Scripts and CI numeric fixtures

Pipelines and interview sandboxes call a deterministic CV contract instead of reimplementing std-over-mean formulas in every language.

How do I compute the coefficient of variation with this calculator?

Send JSON with values (a non-empty array of numbers with non-zero mean) to stat.coefficient_variation. The response returns mean, population_std, sample_std, population_cv, population_cv_percent, sample_cv, sample_cv_percent, n, and sum_squared_deviations.

What happens if the mean is zero?

The request fails with invalid_input because coefficient of variation (std/mean) is undefined when the mean is zero. Validation failures are not charged.

What is sample_cv when the list has only one number?

sample_std, sample_cv, and sample_cv_percent are null because dividing by n minus one would be division by zero. population_cv is zero when that single value is non-zero (std is zero).

Read the full KIT documentation →