Expected Value Calculator
Calculate the expected value, variance and standard deviation of a discrete random variable, or switch to wager mode for the EV per unit staked and the house edge.
Working
| xᵢ | pᵢ | xᵢ · pᵢ | xᵢ² · pᵢ | pᵢ(xᵢ − μ)² |
|---|---|---|---|---|
| 0 | 0.25 | 0 | 0 | 0.25 |
| 1 | 0.5 | 0.5 | 0.5 | 0 |
| 2 | 0.25 | 0.5 | 1 | 0.25 |
| Σ | 1 | 1 | 1.5 | 0.5 |
E(X) = Σ xᵢpᵢ, Var(X) = Σ pᵢ(xᵢ − μ)², σ = √Var(X). When the probabilities sum to exactly 1 this matches the shortcut Var(X) = E(X²) − μ² = 0.5.
What is the Expected Value Calculator?
The ByteTools Expected Value Calculator takes a discrete random variable as a list of value and probability pairs and returns E(X), E(X²), the variance and the standard deviation.
- Add and remove outcome rows with live per-row contributions
- E(X), E(X²), variance and standard deviation
- Validation that the probabilities sum to 1, with optional auto-normalising
- Wager mode with EV per unit staked, house edge and return to player
- Full working table including each pᵢ(xᵢ − μ)² term
- Runs entirely in your browser — nothing leaves the page
How to use the Expected Value Calculator
- 1
Choose discrete random variable mode or wager mode.
- 2
Fill in each outcome's value (or net payoff per unit staked) and its probability between 0 and 1.
- 3
Use Add outcome to add rows and the bin icon to remove them.
- 4
Tick auto-normalise if your probabilities do not already sum to 1.
- 5
Read E(X), the variance and the standard deviation, plus the house edge in wager mode.
About the Expected Value Calculator
The ByteTools Expected Value Calculator takes a discrete random variable as a list of value and probability pairs and returns E(X), E(X²), the variance and the standard deviation. Rows are added and removed one at a time, and each row shows its own contribution to the total as you type so the sum is never a black box.
Wager mode reframes the same maths for betting and decision problems: enter the net payoff per unit staked for each outcome with its probability and you get the expected value per unit, the house edge and the return to player. An even-money bet at 18 in 38 comes out at −5.26%, the familiar American roulette edge.
The tool checks that your probabilities sum to 1 and can rescale them automatically if they do not, so a missing outcome is caught before it quietly skews the answer. Every calculation happens inside your browser, nothing is uploaded to a server, and the page works with no connection at all.
Frequently asked questions
How do you calculate expected value?
Multiply each possible value by its probability and add the results together. For a fair six-sided die that is (1+2+3+4+5+6) ÷ 6 = 3.5, which is the long-run average roll even though 3.5 is never an actual outcome.
Do the probabilities have to add up to 1?
For a genuine probability distribution, yes. This tool warns you when they do not and offers to rescale them, because otherwise you have either missed an outcome or double-counted one. You can also leave them as entered if you are deliberately working with a partial distribution.
What is the house edge and how is it related to expected value?
The house edge is simply the negative of the expected value per unit staked, written as a percentage. An EV of −0.0526 per unit is a 5.26% house edge, meaning the bet loses about 5p of every pound wagered on average over the long run.
Why is the variance useful alongside the expected value?
Two bets can share an expected value but feel completely different. Variance and standard deviation measure how far individual outcomes typically stray from the mean, which is what determines how long a run of results you need before the average settles down.
Can expected value be negative?
Yes, and for almost every commercial bet it is. A negative expected value means the average outcome is a loss, which is exactly what a house edge represents. It does not mean you cannot win in the short term, only that repeated play trends toward the negative figure.
Related tools
Probability Calculator
Work out probabilities for one or two events: complement, union, intersection, conditional probability and the chance of at least one success in n trials.
Dice Probability Calculator
Get exact probabilities for the sum of any number of dice with any number of sides, plus 'at least one' odds, a histogram and the full ways-to-roll table.
Variance Calculator
Calculate population and sample variance from a list of numbers. See the mean, squared deviation table and standard deviation, computed in your browser.
Bayes' Theorem Calculator
Apply Bayes' theorem to get a posterior probability, or switch to diagnostic-test mode for positive and negative predictive value with an expanded 2 × 2 table.
Weighted Average Calculator
Compute a weighted average from value and weight pairs: Σ(value × weight) ÷ Σ(weights). Add rows for grades, portfolios or ratings and see each weight's share.