Expected Value Calculator
Mean, variance and standard deviation of a probability distribution
Last updated September 6, 2026
Method: The exact definitions for a discrete random variable: E(X) = Σ x P(x), Var(X) = Σ P(x)(x − E(X))², and SD = √Var(X). The check E(X²) − E(X)² is computed independently and shown next to the result.
Included: Up to 12 outcomes, probabilities typed as decimals, percentages or fractions, an automatic warning when the probabilities do not total 1, a weight mode that normalizes counts for you, and a row-by-row table of every contribution to the mean and the variance.
Not included: Continuous distributions, conditional expectation, covariance between two variables, and named distributions with parameters (binomial, Poisson, normal). Those need their own tools.
You can type a probability as a decimal (0.25), a percent (25%) or a fraction (1/4). Outcome values may be negative, for example a loss of 5.
🎲 Expected value E(X)
📐 Distribution summary
📊 Outcome by outcome
| Outcome x | P(x) | x × P(x) | x − mean | P(x)(x − mean)² |
|---|---|---|---|---|
| 1 | 0.166667 | 0.1667 | -2.5 | 1.0417 |
| 2 | 0.166667 | 0.3333 | -1.5 | 0.375 |
| 3 | 0.166667 | 0.5 | -0.5 | 0.0417 |
| 4 | 0.166667 | 0.6667 | 0.5 | 0.0417 |
| 5 | 0.166667 | 0.8333 | 1.5 | 0.375 |
| 6 | 0.166667 | 1 | 2.5 | 1.0417 |
| Total | 1 | 3.5 | – | 2.9167 |
The third column adds up to the expected value; the last column adds up to the variance. The standard deviation is the square root of that variance, 2.9167, which is 1.7078.
Deterministic math, not advice. Expected value is a long-run average over many repeats of the same experiment, not a prediction of any single trial. Results use the exact definitions E(X) = Σ x P(x) and Var(X) = Σ P(x)(x − E(X))².
Expected value: the complete guide
An expected value calculator turns a list of outcomes and their probabilities into one number: the long-run average result. The formula is E(X) = Σ x P(x). For a fair six-sided die every face has probability 1/6, so the expected value is 21/6 = 3.5, with a variance of 2.9167 and a standard deviation of about 1.7078. Enter up to 12 outcomes above and the mean, variance and spread update as you type.
Three sister tools cover the neighboring questions. The Probability Calculator finds the probabilities in the first place (single events, A and B, A or B, at least once), the Standard Deviation Calculator works from a raw list of observed data rather than a probability model, and the Average Calculator gives the plain mean, median and mode when every value carries equal weight. Use this page when each outcome has its own probability attached and you want the weighted average plus its risk.
How expected value is calculated
Expected value is a probability-weighted average. Every outcome contributes its own value multiplied by how often it happens:
E(X) = Σ x · P(x) = x₁P(x₁) + x₂P(x₂) + … + xₙP(xₙ) The sum runs over every outcome the random variable can take. Two conditions make the result valid: each probability must sit between 0 and 1, and all of them together must total exactly 1. If your probabilities add to 0.95 you have forgotten an outcome; if they add to 1.4 you have double counted one. The calculator checks the total on every keystroke and offers to rescale the rows proportionally when it is off.
Worked example: a $5 raffle ticket
A club sells raffle tickets for $5 each. One ticket in a thousand wins the $1,000 grand prize, eight in a thousand win $100, and fifty in a thousand win $10. Everything else wins nothing. Work in net terms, subtracting the $5 you paid from every prize, so the grand prize becomes $995, the second prize $95, the small prize $5, and a losing ticket is −$5. The probability of losing is 1 − 0.001 − 0.008 − 0.05 = 0.941.
| Result | Net x | P(x) | x × P(x) | P(x)(x − mean)² |
|---|---|---|---|---|
| Grand prize | $995 | 0.001 | 0.995 | 995.41 |
| Second prize | $95 | 0.008 | 0.760 | 76.36 |
| Small prize | $5 | 0.050 | 0.250 | 2.96 |
| No prize | −$5 | 0.941 | −4.705 | 4.98 |
| Total | – | 1.000 | −2.70 | 1,079.71 |
The expected value is −$2.70 per ticket. Buy 20 tickets and the average loss is $54; buy 100 and it is $270. The variance is 1,079.71 and the standard deviation is √1,079.71 = $32.86, far larger than the mean itself. That gap is the whole character of a raffle: the typical result is a small loss, the rare result is a large win, and the average sits close to the small loss because the win almost never happens. Note also that the gross expected prize is only $2.30 per ticket, which is what the $5 price is set against.
Variance and standard deviation
The expected value alone hides how wild the outcomes are. Variance measures the probability-weighted average squared distance from the mean:
Var(X) = Σ P(x)(x − E(X))² = E(X²) − E(X)² Both forms give the same answer, and the calculator reports E(X²) so you can verify the shortcut yourself. Standard deviation is simply the square root of the variance, which puts the spread back into the same units as the outcomes: dollars, points, hours. That is why the standard deviation, not the variance, is the number people quote when they talk about risk.
Worked example: the fair die, checked two ways
Take the six faces of a fair die, each with probability 1/6. The mean is (1 + 2 + 3 + 4 + 5 + 6)/6 = 21/6 = 3.5. For the variance, square each face first: (1 + 4 + 9 + 16 + 25 + 36)/6 = 91/6 = 15.1667. That is E(X²). Subtract the square of the mean, 3.5² = 12.25, and you get a variance of 2.9167, exactly 35/12. The standard deviation is √2.9167 = 1.7078. Working the long way, the squared distances from 3.5 are 6.25, 2.25 and 0.25 for the pairs 1 and 6, 2 and 5, 3 and 4, each with weight 1/6, and (2 × 6.25 + 2 × 2.25 + 2 × 0.25)/6 = 17.5/6 = 2.9167. The two routes agree, which is the standard way to catch an arithmetic slip.
Expected value and spread of common chance devices
These are the distributions that show up in most homework problems, computed with the formulas above. Every die is assumed fair, so each face carries probability 1/n.
| Random variable | Outcomes | E(X) | Variance | Std dev |
|---|---|---|---|---|
| Coin flip (0 or 1) | 2 | 0.5 | 0.25 | 0.5 |
| Four-sided die | 4 | 2.5 | 1.25 | 1.1180 |
| Six-sided die | 6 | 3.5 | 2.9167 | 1.7078 |
| Eight-sided die | 8 | 4.5 | 5.25 | 2.2913 |
| Twelve-sided die | 12 | 6.5 | 11.9167 | 3.4521 |
| Twenty-sided die | 20 | 10.5 | 33.25 | 5.7663 |
| Sum of two dice | 11 | 7 | 5.8333 | 2.4152 |
The pattern is worth remembering: the mean of an n-sided die is (n + 1)/2 and its variance is (n² − 1)/12. The sum of two dice keeps a mean of 7 but its variance is exactly double one die, because variances of independent variables add while standard deviations do not. Load the Sum of two dice example above to see all eleven outcomes with their weights 1, 2, 3, 4, 5, 6, 5, 4, 3, 2, 1 out of 36.
Same expected value, very different risk
Expected value on its own is never enough to choose between options. These four payoffs all have an expected value of exactly $10,000, yet almost nobody is indifferent between them:
| Option | E(X) | Variance | Std dev | Chance of $0 |
|---|---|---|---|---|
| $10,000 guaranteed | $10,000 | 0 | $0 | 0% |
| $12,000 or $8,000, 50/50 | $10,000 | 4,000,000 | $2,000 | 0% |
| $20,000 or nothing, 50/50 | $10,000 | 100,000,000 | $10,000 | 50% |
| $100,000 at 10%, else nothing | $10,000 | 900,000,000 | $30,000 | 90% |
The mean says these are equivalent. The standard deviation column says they are not remotely equivalent, ranging from $0 to $30,000 of typical deviation. This is exactly why the calculator reports the spread next to the mean rather than hiding it: a decision made on expected value alone quietly assumes you can absorb the worst row without changing your life.
How to use this calculator
- Pick a starting point: load one of the examples (fair die, coin flip, sum of two dice, raffle ticket, business decision) or start typing over the default rows.
- Choose what the second column holds: pick Probability when your numbers already add to 1, or Weight when you have counts, frequencies or odds ratios that should be normalized for you.
- Say whether the outcomes are dollars: switching to the dollar format prints results with a currency symbol and two decimals, which is what you want for payoffs, costs and prizes.
- Enter each outcome and its probability: type probabilities however you like, as 0.25, 25% or 1/4. Outcome values may be negative for losses.
- Add or remove rows: up to 12 outcomes are supported; a distribution needs at least two to be interesting.
- Read the total: if the probabilities do not land on 1 you get a warning and a one-click rescale, so a typo never silently corrupts the mean.
- Read the result: the headline is E(X). Below it sit the variance, the standard deviation, E(X²) and the most likely single outcome, then a row-by-row table showing exactly where the mean and the variance came from.
Who this calculator is for
- Statistics students checking homework on discrete random variables, where the mean, variance and standard deviation are the three answers every problem asks for.
- Business analysts valuing a project with several scenarios, each carrying its own probability and payoff.
- Insurance and warranty shoppers comparing a fixed premium against an uncertain repair or claim.
- Game designers and players pricing a die roll, a loot table or a card draw in points rather than dollars.
- Anyone facing a gamble who wants to see the average and the spread before deciding, instead of only the headline prize.
Second worked example: is the extended warranty worth it?
A retailer offers a $120 extended warranty on an appliance. From the failure rate you estimate a 12% chance of a repair that would cost you $600 out of pocket, and an 88% chance of no repair at all. Without the warranty your cost is a random variable: $600 with probability 0.12, $0 with probability 0.88. Its expected value is 0.12 × 600 = $72, and its standard deviation is $194.98. With the warranty your cost is a certainty: $120, with a standard deviation of $0.
So the warranty costs $48 more than the risk it removes. On expected value alone you decline it. The break-even failure probability is 120 ÷ 600 = 0.20, so the warranty only pays for itself if you believe the appliance fails at least 20% of the time. What the extra $48 actually buys is the removal of a $600 shock, and whether that is worth $48 depends on whether an unexpected $600 would hurt. That is the honest way to read every expected value comparison: the mean tells you the price of the risk, and the standard deviation tells you why someone might pay more than that price to avoid it.
Key terms explained
- Random variable: a quantity whose value depends on chance, written X. Here it is discrete, meaning it takes a countable list of values.
- Probability distribution: the full list of outcomes with their probabilities. It is complete only when the probabilities total 1.
- Expected value E(X): the probability-weighted mean, also written μ. It is the long-run average, not a prediction of one trial.
- Variance Var(X): the weighted average squared distance from the mean, in squared units.
- Standard deviation: the square root of the variance, in the original units, and the usual measure of risk or spread.
- Mode: the single most likely outcome. It often differs from the expected value.
- Fair game: a bet whose expected value is exactly 0. Anything below 0 favors the other side.
- Law of large numbers: the principle that the average of many independent trials converges on the expected value as the number of trials grows.
What changes the result the most
- Probabilities on the extreme outcomes: moving weight onto the largest or smallest value shifts the mean fastest and inflates the variance dramatically.
- How far apart the outcomes are: the mean depends on the values, but the variance depends on their squared distances, so doubling the spread quadruples the variance.
- Whether you work in gross or net terms: a $1,000 prize on a $5 ticket is $995 net. Mixing the two conventions is the most common source of a wrong answer.
- A missing outcome: if the probabilities total less than 1, the missing case usually has value 0 or a small loss, and adding it always pulls the mean down.
- Rounding the probabilities: entering 0.17 six times instead of 1/6 changes the total to 1.02 and distorts every result. Fractions avoid this entirely.
Practical tips
- Always list the "nothing happens" case. It is the easiest outcome to forget and it usually carries most of the probability.
- Use weight mode for counts. Eleven sums of two dice with weights 1 through 6 and back down are far easier to type than eleven fractions over 36.
- Sanity-check with the shortcut. Compare the variance in the result card against E(X²) − E(X)² using the value shown. If they disagree, a row is wrong.
- Scale the mean to your horizon. Expected value per trial times the number of trials gives the expected total: 1,000 die rolls average 3,500 pips, and 10,000 appliances with a 12% failure rate cost $720,000 in repairs.
- Compare like with like. Two options are only comparable on expected value if both are measured over the same period and in the same units.
- Look at the worst row, not just the mean. If the largest loss would be unrecoverable, expected value is the wrong decision rule no matter how favorable it looks.
Limitations and assumptions
- It handles discrete random variables only. A continuous distribution replaces the sum with an integral and needs a different tool.
- Your probabilities are taken as given. If they are estimates, the expected value inherits every bit of that uncertainty, and no amount of decimal places makes a guessed probability more accurate.
- It assumes the outcomes are mutually exclusive and exhaustive, so exactly one of them happens on each trial.
- Expected value describes the long run. Over a handful of trials the realized average can sit far from it, which is exactly what the standard deviation quantifies.
- It uses the population variance formula, weighted by probability. It does not apply the n − 1 sample correction, which belongs to data you have observed rather than a model you have specified.
- It does not model utility. In real decisions the value of a dollar is not constant, which is why people insure against losses with a negative expected value.
How it compares to related calculators
This page answers "what is the average outcome, and how much does it vary?" when each outcome has a probability. If your question is different, a sister tool fits better:
- To find the probabilities themselves, use the Probability Calculator.
- To measure spread in a list of observed numbers with no probabilities attached, use the Standard Deviation Calculator.
- For an unweighted mean, median and mode, use the Average Calculator.
- To count the arrangements behind a probability, use the Permutation and Combination Calculator.
- To convert a probability into a percentage or back, use the Percentage Calculator.
Sources
Every number on this page comes from deterministic mathematics rather than an external data source, so there is nothing to cite for the results themselves. Specifically:
- The expected value of a discrete random variable is defined as E(X) = Σ x P(x), and the variance as Var(X) = Σ P(x)(x − E(X))², with the identity Var(X) = E(X²) − E(X)². These are exact definitions, not measured quantities.
- The dice and coin figures follow from those definitions on a uniform distribution over n equally likely faces, giving mean (n + 1)/2 and variance (n² − 1)/12.
- The raffle, warranty and business scenarios are illustrative examples with stated probabilities. They are worked arithmetic, not claims about any real product, prize pool or failure rate.
⚠️ Common mistakes & edge cases
Probabilities that do not add to 1
Entering 0.001, 0.008 and 0.05 for the three prizes and stopping there leaves 94.1% of the probability unaccounted for. The mean would come out as $2.01 instead of −$2.70. Always include the "nothing happens" row.
Mixing gross prizes with net stakes
If you enter the $1,000 prize but forget to subtract the $5 ticket, and also enter −$5 for a loss, you are mixing two conventions. Pick one: net every row, or list gross prizes and subtract the ticket price once at the end.
Averaging the outcomes instead of weighting them
The plain average of $995, $95, $5 and −$5 is $272.50. The expected value is −$2.70. Ignoring the probabilities is the single biggest error in expected value problems.
Rounding 1/6 to 0.17
Six rows of 0.17 total 1.02, which inflates every result by 2%. Type the fraction 1/6 instead, or use weight mode with six rows of 1.
Expecting the expected value to actually happen
A die never lands on 3.5, and a raffle ticket never loses exactly $2.70. Expected value is a long-run average across many trials, not a forecast for the next one.
Comparing variances across different units
Variance is in squared units, so a variance of 1,079.71 is in "dollars squared" and cannot be compared to a mean in dollars. Convert to the standard deviation, $32.86, before you interpret the spread.
❓ Frequently asked questions
What is the expected value formula?
The expected value of a discrete random variable is E(X) = sum of x times P(x). You multiply every outcome by its probability and add the products together. For a fair six-sided die that is 1(1/6) + 2(1/6) + 3(1/6) + 4(1/6) + 5(1/6) + 6(1/6) = 21/6 = 3.5.
How do you calculate expected value step by step?
List every possible outcome and its probability, check that the probabilities add to 1, multiply each outcome by its probability, then add the products. The calculator shows that x times P(x) column so you can see each contribution. For a $5 raffle ticket with a $1,000 prize at 0.1%, a $100 prize at 0.8% and a $10 prize at 5%, the products are 0.995, 0.760, 0.250 and -4.705, which sum to an expected value of -$2.70 per ticket.
Do the probabilities have to add up to 1?
Yes, for a complete probability distribution. If your outcomes are exhaustive and mutually exclusive, their probabilities must total exactly 1 (100%). This calculator flags any total that is not 1 and offers to rescale the rows proportionally. If you only have relative frequencies or counts, switch the second column to Weight and the tool normalizes them for you.
What is the expected value of a fair six-sided die?
3.5. Every face has probability 1/6, so E(X) = (1 + 2 + 3 + 4 + 5 + 6)/6 = 21/6 = 3.5. No single roll ever gives 3.5, which is the point: expected value is the long-run average, not a value you expect to see on any one trial. Over 1,000 rolls the total is expected to be about 3,500.
How do you find the variance from an expected value?
Variance is the probability-weighted average squared distance from the mean: Var(X) = sum of P(x)(x - E(X))^2. The shortcut form is Var(X) = E(X^2) - E(X)^2. For a fair die, E(X^2) = 91/6 = 15.1667 and E(X) = 3.5, so the variance is 15.1667 - 12.25 = 2.9167 and the standard deviation is the square root, about 1.7078.
What is the difference between expected value and average?
A plain average treats every number equally; expected value weights each outcome by how likely it is. If the probabilities are all equal, the two are identical, which is why the mean of a fair die (3.5) matches the simple average of 1 through 6. When probabilities differ, only the weighted version is correct.
Can expected value be negative?
Yes. A negative expected value means the average result over many repeats is a loss. The $5 raffle ticket above has an expected value of -$2.70, so buying 20 tickets loses about $54 on average. Outcome values in this calculator may be negative; probabilities may not.
What does a large standard deviation tell me?
It tells you how far individual results typically land from the expected value. Two choices can share an expected value of $10,000 while one pays $12,000 or $8,000 on a coin flip (standard deviation $2,000) and the other pays $100,000 with 10% probability or nothing (standard deviation $30,000). Same average, very different risk.
How many outcomes can I enter?
Up to 12 rows. That covers the sum of two dice (11 outcomes), a small prize table, or a decision with several scenarios. If your distribution has more outcomes than that, group the small ones into a single bucket with their combined probability and an average value; the expected value barely moves as long as the grouped values are close together.
Can I type probabilities as fractions or percentages?
Yes. The probability field accepts 0.25, 25% and 1/4 interchangeably, so a fair die can be entered as six rows of 1/6 without rounding errors. Values are parsed the moment you type them, and the calculator shows the resulting total so you can confirm it lands on 1.
What is E(X squared) used for?
It is the expected value of the squared outcomes and it is the fastest route to the variance through Var(X) = E(X^2) - E(X)^2. The calculator shows it alongside the mean so you can check the variance by hand. It is also the building block for the second moment in more advanced statistics.
Is expected value the same as the most likely outcome?
No. The most likely outcome is the one with the highest probability, sometimes called the mode. Expected value is the weighted average of all outcomes and often falls between them, or on a value the variable can never take at all, like 3.5 on a die. The calculator reports both.
How does expected value apply to insurance and warranties?
It converts an uncertain cost into a single comparable number. If a repair costs $600 and happens with probability 0.12, the expected cost of going without coverage is $72. A $120 warranty therefore costs $48 more than the risk it removes in expectation, and only breaks even if the failure probability reaches 20% (120 / 600). What you buy for that $48 is the removal of variance.
Is this expected value calculator free?
Yes. It runs entirely in your browser, needs no sign-up, and there is no limit on how many distributions you enter. Nothing you type is sent anywhere, so you can use it for coursework, business scenarios, or checking homework as often as you like.
💡 Good to know
Averages settle down faster than totals
The standard deviation of the average of n independent trials is the single-trial standard deviation divided by √n. For a die that is 1.7078 over 10, so the average of 100 rolls typically lands within about 0.17 of 3.5 while the total can still be hundreds of pips away from 3,500.
Variances add, standard deviations do not
Roll two independent dice and the variance of the sum is 2.9167 + 2.9167 = 5.8333, but the standard deviation is √5.8333 = 2.4152, not 1.7078 + 1.7078. This is why spreading a bet across independent trials reduces relative risk.
A negative expected value is not always a bad deal
Insurance has a negative expected value for the buyer by design, otherwise no insurer could operate. People buy it anyway because it converts a rare catastrophic loss into a small predictable cost. Expected value prices the risk; your tolerance for the worst row decides the rest.