Quick answer: The expected value formula is E(X) = x1 x p1 + x2 x p2 + ... + xn x pn: multiply each possible value by its probability, then add. A fair die gives E(X) = 3.5, a fair coin game gives 0, and the simplified lottery ticket in the preset gives exactly 0. Enter your outcomes above and this expected value calculator — an EV calculator under its shorter name — returns E(X), E(X squared), the variance and the standard deviation, and it checks that your probabilities add up to 1 before it believes them.

How to use this expected value calculator

Step 1 — Set the probability format first. Use the selector above the table to say whether you will type probabilities as decimals (0.25, adding up to 1) or as percentages (25, adding up to 100). The calculator states the choice in plain words under the table and shows a running total as you type, so the format is never a guess. Mixing the two — typing 25 while the calculator expects 0.25 — is the single most common expected value error, and the running total exposes it immediately.

Step 2 — Enter one row per outcome. Each row holds a value x and its probability p. Values can be money, points, measurements or counts, and they can be negative: a ticket price, a loss or a cost is simply a negative value. Add rows with the Add row button and remove them with the cross on each row. There is no fixed number of outcomes; a die needs six rows, a coin game needs two, and a prize structure might need ten.

Step 3 — Watch the total. Under the table the calculator shows the sum of your probabilities and what it should be. If the sum is off by more than a small rounding tolerance, a warning appears and no result is reported. Fix the rows, or — only if you are sure the relative sizes are right — press the clearly labelled Normalise button, which rescales every probability in proportion so the total becomes exactly 1 and says that it has done so.

Step 4 — Read the result set, not just the headline. The headline is E(X), the expected value. Underneath sit E(X squared), the variance Var(X) and the standard deviation, which describe the spread around that average. Save, copy or email the summary when you need the figures elsewhere. Everything runs in your browser; nothing you enter is uploaded, stored or shared.

The expected value formula

The expected value formula for a discrete random variable is:

E(X) = x1p1 + x2p2 + ... + xnpn

Read it as a weighted average. An ordinary average gives every result the same weight; expected value gives each possible value a weight equal to its probability. Likely outcomes pull the average toward themselves, rare outcomes barely move it, and an outcome with probability 0 does not move it at all. That is the whole of how to calculate expected value: the arithmetic is just multiplication and addition, and all the real work is in listing the outcomes honestly and getting their probabilities right.

Three conditions hide inside the formula. First, the rows must cover every possible outcome, including the dull one where nothing happens. Second, no outcome may be counted twice. Third, the probabilities must add up to exactly 1 — the formula silently assumes it, which is why this calculator checks it out loud. When those conditions hold, E(X) has a precise meaning: it is the average result per trial you would approach if the process were repeated a very large number of times under identical conditions.

Expected value is also linear: the expected value of a sum is the sum of the expected values, whether or not the parts are independent, and doubling every value doubles the expected value. Play a game twice and the expected total is twice the single-game EV — which is why a casino can add up the EV of millions of small bets into something close to a certainty.

How to calculate expected value step by step

Here is the method in full, the same one the calculator follows. Step one: define the trial precisely — one roll, one ticket, one customer, one day. Expected value is always per trial, and confusion about what counts as one trial corrupts everything after it. Step two: list every outcome of that trial and the value attached to it, using net values: if a ticket costs 1 and pays 100, the winning outcome is worth +99, not +100, and the losing outcome is worth -1, not 0.

Step three: attach a probability to each outcome and add them up — they must total 1 (or 100 in percentage form), or an outcome is missing or duplicated. Step four: multiply each value by its probability, keeping the signs. Step five: add the products. That sum is E(X).

A miniature example: a game pays +4 if a fair coin lands heads and -2 if it lands tails. Each outcome has probability 0.5, the total is 1, the products are +2 and -1, and the expected value is +1 per game. Positive — but note what it does not say: you will never actually win 1 in this game. Every single game ends at +4 or -2. The expected value lives only in the average, a point the honesty section below returns to, because misunderstanding it is expensive.

Worked example: the fair die, in full

The fair six-sided die is the cleanest expected value example there is, because every outcome has the same probability, 1/6. The table below works it completely — value, probability, the product x times p that feeds E(X), and the squared terms that feed the variance — so you can check every figure by hand and then reproduce it with the fair die preset above.

Value xProbability px times px squaredx squared times p
10.16670.166710.1667
20.16670.333340.6667
30.16670.500091.5000
40.16670.6667162.6667
50.16670.8333254.1667
60.16671.0000366.0000
Total1.00003.5000—15.1667

So E(X) = 3.5 exactly (21 divided by 6, before the rounded probabilities in the table blur it), and E(X squared) = 91 divided by 6 = 15.1667. Two things are worth noticing. First, 3.5 is not a possible roll: expected value is the centre of the distribution, not a forecast of the next result. Second, the equal probabilities make this example a plain average in disguise — the average of 1 to 6 is also 3.5. Expected value earns its keep precisely when the probabilities are not equal, as the next section shows.

More worked examples: a coin game and a lottery ticket

The coin-flip game. You gain 1 if a fair coin lands heads and lose 1 if it lands tails. The values are +1 and -1, each with probability 0.5, so E(X) = 0.5 - 0.5 = 0. This is a genuinely fair game: over a long run of flips the gains and losses cancel, and the average result per game approaches 0. Its variance is 1 and its standard deviation is 1, which is the honest footnote — fair on average, but still swinging by a full unit on every single flip. Load it with the coin-flip game preset.

The lottery ticket. The simplified ticket in the preset costs 1 and pays 100 with probability 0.01. As net outcomes that is -1 with probability 0.99 and +99 with probability 0.01, giving E(X) = -0.99 + 0.99 = 0 exactly. The ticket is, by construction, perfectly fair — and it is still a terrible way to feel rich, because 99 times out of 100 you simply lose your 1, and the standard deviation is 9.9499, enormous next to the average of 0.

Real lotteries differ in ways that all push the expected value negative: the operator keeps a share of the stakes, there are many prize tiers, and the jackpot probability is typically one in millions rather than one in a hundred. The method, though, is identical — and entering a real prize table above is a sobering exercise. A negative result is the normal finding, not an error.

From expected value to variance and standard deviation

Expected value tells you where the average sits; it says nothing about how wild the ride is. Two games can share an EV of 0 while one risks pennies and the other risks a fortune. Variance fills that gap. The route runs through a second expected value: E(X squared), the probability-weighted average of the squared values. Then:

Var(X) = E(X squared) − (E(X)) squared

For the die: 15.1667 − 12.25 = 2.9167. Variance is measured in squared units — squared pips, squared pounds — which makes it hard to picture, so the standard deviation takes the square root: the square root of 2.9167 is 1.7078, back in the original units. Read it loosely as the typical distance of a result from the expected value. A single die roll landing within about 1.7 of 3.5 is unremarkable; that is most rolls.

Decisions made on EV alone ignore the chance of a bad run: a positive-EV opportunity with a huge standard deviation can still wipe out a small budget before the long run arrives. Reporting the spread alongside the average is the difference between an EV calculator that flatters gambles and one that describes them.

The expected value of a random variable

In textbook language, everything above is the expected value of a random variable: a variable X whose value is decided by a random process, together with the probabilities of its possible values. The die is a random variable that takes 1 to 6; the lottery ticket is a random variable that takes -1 or +99. Writing E(X) instead of spelling out the sum is just shorthand, but it is shorthand worth knowing, because every statistics text, exam and paper uses it — and because it makes the variance formula, Var(X) = E(X squared) − (E(X)) squared, compact enough to remember.

This calculator handles discrete random variables: ones with a listable set of outcomes, which is why it works from a table of rows. A continuous random variable — a measurement like height, time or temperature — takes infinitely many values, and its expected value is an integral over its probability density function rather than a sum. The idea is identical, but no finite table can hold it, and this page does not pretend otherwise.

One more piece of vocabulary: textbooks often call E(X) the mean of the distribution, written with the Greek letter mu. Mean, expected value and EV are the same quantity viewed from three angles: the centre, the long-run average, and the decision-maker's shorthand.

Using expected value to compare choices — honestly

Expected value earns its reputation as a decision tool: when two options can both be written as outcomes with probabilities, the one with the higher EV gains more — or loses less — on average. Insurance is the mirror example. A policy almost always has negative EV for the buyer (the premium exceeds the expected payout; that margin is how insurers operate), yet buying it can still be right, because the uninsured loss would be catastrophic rather than merely average-sized. EV measures the centre of a distribution; it does not measure how much a bad tail would hurt you.

So the honest rules for using EV are these. Expected value is a long-run average, not a prediction for a single trial. One roll, one ticket, one trade will land on one actual outcome, almost never on the EV itself. A positive EV does not guarantee profit — it does not even make profit likely on a single trial; the die preset's cousin, the lottery preset, pairs an EV of exactly 0 with a 99 percent chance of losing on any given ticket. And the long run needs time and budget to arrive: the law of large numbers promises convergence, not a schedule, and a process you can only afford to repeat five times does not get to claim its long-run average.

Used with those limits in view, EV is still one of the most clarifying numbers in everyday decision-making: it exposes games priced to lose and forces vague hopes into explicit probabilities that can be argued with. Argue with the probabilities too — they, not the arithmetic, are where EV calculations go wrong.

Common mistakes

Forgetting the losing outcome. The most frequent error of all: listing only the prizes. A ticket that pays 100 with probability 0.01 has an EV of +1 only in a table that omits the 0.99 chance of losing the price. Every outcome belongs in the table, including nothing happens. Using gross instead of net values. If entry costs something, subtract it from every outcome first, as the lottery example does; mixing gross prizes with a separately remembered cost double-counts the good news.

Probabilities that do not total 1. A total of 0.9 means a tenth of reality is missing from the table; a total of 1.1 means something is counted twice. Textbook problems occasionally hand you weights instead of probabilities — then dividing each weight by the total weight is the correct fix, and it is exactly what the Normalise button does, labelled as such rather than hidden. Mixing decimals and percentages. 0.25 and 25 are the same probability in different clothes; a table containing both is wrong by a factor of 100 in one row. The format selector and running total exist to catch this.

Reading EV as a promise. Treating 3.5 as the likely roll, or a positive EV as a sure profit, mistakes an average for a forecast — the honesty section above covers this in full. Rounding probabilities early. Entering 0.33 three times totals 0.99 and trips the sum check for a reason: keep more decimal places (0.3333) or use the exact fractions your problem gives you, and let the tolerance absorb only genuine rounding dust.

Honest limits: what this calculator does not do

This calculator does exact arithmetic on the table you give it — and only that. It does not know whether your probabilities are right. Probabilities taken from a textbook are exact; probabilities estimated from data, forecasts or judgement carry uncertainty that no calculator can remove, and the EV inherits all of it. If a probability in your table is a guess, the expected value is a guess with good arithmetic.

It handles discrete outcomes in a finite table. It does not integrate continuous distributions, fit distributions to data, or simulate; and it treats each trial as one self-contained event, so processes whose probabilities change as they unfold — drawing cards without replacement, for instance — must be modelled outcome by outcome, not with one static table.

Finally, a note on scope: nothing here is financial, gambling or investment advice. An expected value is a description of a probability model, not a recommendation. Where real money is involved, the spread figures and the honesty warnings on this page matter at least as much as the headline number — a positive EV you cannot afford to repeat is not an opportunity, it is a risk with good public relations.

Sources and References