Variance of a Distribution Calculator
Variance is the standard way to measure how spread out the outcomes of a random variable are. For a discrete probability distribution, where each possible value carries a known probability, the variance is the probability-weighted average of the squared distances between each value and the distribution's mean. This calculator takes up to three value-and-probability pairs, computes the mean, and then returns the variance and the standard deviation that follows from it. The method is the textbook definition: weight each squared deviation by its probability and add them up. You enter the values your random variable can take alongside the probability of each, and the tool reports the mean, the variance in squared units, and the standard deviation in the original units. Every figure is computed deterministically from the formula shown below, never estimated, so the worked example reconciles exactly with the results on screen. Variance underpins much of statistics: it drives confidence intervals and risk measures in finance. A larger variance means outcomes scatter further from the center, while a variance near zero means they cluster tightly. Remember that the probabilities should sum to one for a genuine distribution. Use this tool to check a homework problem or to quantify the risk of a discrete payoff.
The variance of a discrete distribution is sum of p(x - mean)^2, where the mean is sum of (x times p). For values 1, 2 and 3 with probabilities 0.2, 0.3 and 0.5, the mean is 2.30 and the variance is 0.61.
Variance formula
mean = sum of ( x_i x p_i )
variance = sum of ( p_i x (x_i - mean)^2 )
standard deviation = sqrt(variance)
x_i = each value, p_i = its probability
The mean is the probability-weighted average of the values. The variance weights the squared distance of each value from that mean by its probability and adds the terms, giving the average squared spread of the distribution.
Worked example
Values 1, 2 and 3 occur with probabilities 0.2, 0.3 and 0.5.
- Mean = (1 x 0.2) + (2 x 0.3) + (3 x 0.5) = 0.2 + 0.6 + 1.5 = 2.30
- Value 1: 0.2 x (1 - 2.3)^2 = 0.2 x 1.69 = 0.338
- Value 2: 0.3 x (2 - 2.3)^2 = 0.3 x 0.09 = 0.027
- Value 3: 0.5 x (3 - 2.3)^2 = 0.5 x 0.49 = 0.245
- Variance = 0.338 + 0.027 + 0.245 = 0.61
The variance is 0.61 and the standard deviation is the square root, about 0.78. These are the calculator's default inputs, so the result above matches the widget exactly.
Variance calculator: frequently asked questions
What is the variance of a probability distribution?
Variance measures how spread out the outcomes of a random variable are around their mean. For a discrete distribution it is the probability-weighted average of the squared distances of each value from the mean. A small variance means outcomes cluster near the mean; a large variance means they scatter widely.
How is the variance formula applied?
First find the mean, the sum of each value times its probability. Then for each value subtract the mean, square the difference, multiply by that value's probability, and add the results. The total is the variance. The standard deviation is the square root of the variance.
Do the probabilities have to add up to one?
For a valid probability distribution the probabilities should sum to one. This calculator computes the mean and variance from whatever probabilities you enter, so confirm they add to one before trusting the result. If they do not, the figures describe a weighted set rather than a true distribution.
What is the difference between variance and standard deviation?
Variance is in squared units of the variable, which can be hard to interpret directly. The standard deviation is the square root of the variance and shares the same units as the values, so it is often the more intuitive measure of spread. Both convey the same information.
How does this differ from sample variance?
This tool computes the variance of a known probability distribution, weighting each squared deviation by its probability. Sample variance instead estimates spread from observed data and divides by the number of observations (or that number minus one). Use the distribution formula when you know the probabilities in advance.
Official sources
- Statistics and probability distributions reference: US National Institute of Standards and Technology (NIST). As at 25 June 2026.
Reviewed by the CalculatorHub team, edited by James Graham, 25 June 2026. See our methodology. This is general information, not financial, tax, legal or investment advice.