Coefficient of Variation Calculator
Relative dispersion, s ÷ mean × 100 %, at the sample or population divisor you choose.
What the coefficient of variation calculator does
It divides a standard deviation by the mean and prints the result as a percentage, which is what makes two series with different units comparable. CV = s ÷ mean × 100 %; the series 2, 4, 4, 4, 5, 5, 7, 9 has a mean of 5, a sample s of 2.138089935 and a CV of 42.76179871 %.
The divisor is a control because it is a claim about the data: n − 1 for a sample, n for a population. The page prints which one it used, together with n, the mean and s, so the ratio can be recomputed by hand.
A mean of zero is refused by name, because the ratio has no value there. A mean near zero is printed with the same warning in the copy rather than hidden: the coefficient of variation becomes unstable as the mean approaches zero, and a reader comparing two series should look at the mean as well as the percentage.
A value that is not a number is refused with its line number, fewer values than the chosen divisor needs are refused with the count, and a series longer than 100 000 values is refused. Figures print to ten significant figures with trailing zeros trimmed.
How to use it
Paste your data into the text box, one value per line.
Set Divisor to sample (n − 1) or population (n).
Press Run. The result prints the divisor, n, the mean, s and the coefficient of variation.
Worked example
Input with the default series and the sample divisor:
Mean: 5
s: 2.138089935
CV: 42.76179871 % (s ÷ mean × 100)
Why it runs in your browser
The ratio is computed in this tab. Your data is never uploaded.
The page divides a standard deviation by a mean and prints the result as a percentage, which is what makes two series with different units comparable. The series 2, 4, 4, 4, 5, 5, 7, 9 has a mean of 5, a sample s of 2.138089935 and a coefficient of variation of 42.76179871 %.
The divisor is a control: n − 1 for a sample and n for a population. The page prints which one it used, with n, the mean and s, so the ratio can be recomputed by hand.
A mean of zero is refused by name, and a mean near zero is printed with the warning that the ratio becomes unstable there.
Why divide by the mean
A standard deviation carries the data's unit, so a 2 cm spread on a 5 cm part and a 2 cm spread on a 5 m beam are not comparable as numbers. Dividing by the mean removes the unit and puts both on a percentage scale, which is what lets a lab compare assays and a factory compare lines.
The ratio is dimensionless but not assumption-free: it needs a meaningful zero, a positive mean and an interpretation of the mean as the scale of the measurement. A temperature in °C is the classic failure, because 0 °C is a convention rather than an absence.
The divisor and the mean near zero
The sample divisor is n − 1 and the population divisor is n, and the page makes the choice a control because it is a claim about the data. A sample that is the whole population has a population deviation; a sample drawn from a larger one has a sample deviation.
Close to a mean of zero the ratio explodes: a mean of 0.01 with the same s gives a hundred times the percentage. The page prints the mean on the same answer so the reader can see it, and refuses a mean of exactly zero because the division has no value.
How to use Coefficient of Variation Calculator
Paste your data into the text box, one value per line.
Set Divisor to sample (n − 1) or population (n).
Press Run. The result prints the divisor, n, the mean, s and the coefficient of variation.
What to Expect
Best for
- Comparing the spread of two series measured in different units
- Reporting assay or process variability as a percentage
- Checking a coefficient of variation from a summary
Not ideal for
- A measurement with an arbitrary zero, such as a temperature in °C
- A mean that is at or near zero, where the ratio is unstable
- A weighted or grouped series, which needs its own formula
What this tool keeps
- The values you pasted and the divisor you chose
- n, the mean and s, so the ratio can be recomputed
What may need cleanup
- Values separated by commas, which have to become one per line
- A series in a unit with an offset zero, which should be converted first
Common errors
- Comparing a sample CV with a population CV without saying which
- Reading a CV on a mean near zero as a stable percentage
Example use cases
- Comparing two instruments' repeatability
- Reporting a batch's variability as a percentage
- Checking a published CV against the raw data
Sample input
The eight values 2, 4, 4, 4, 5, 5, 7, 9, with the sample divisor.
Sample output
Mean 5, s 2.138089935, CV 42.76179871 %.
Who this is for
- Analysts comparing variability across units
- Students learning relative dispersion
Frequently asked questions
Should I use the sample or the population divisor?
Use the sample divisor when your data is a sample from a larger population, and the population divisor when it is the whole population. The page prints which one it used so the figure is never ambiguous.
Why is a mean of zero refused?
The coefficient of variation divides by the mean, and division by zero has no value. The page names the zero mean rather than printing an infinity.
Is a higher coefficient of variation always worse?
Not by itself. A higher CV means more spread relative to the mean, which may be expected — a biological measurement is usually more variable than a machined part. The page reports the number and leaves the judgement to the context.
Can I use it with negative values?
The arithmetic works, but the result is hard to interpret when the values straddle zero, because the mean can be small while the spread is large. The page prints the mean beside the percentage so that case is visible.
Build custom tools for your store
Join the SDK program to create useful ecommerce utilities for your store.