Dice, coin and card probability calculator

Exact probability of dice sums, coin-flip heads and streaks, drawing special cards from a deck and each 5-card poker hand, as a fraction and 1 in N.

Drafted with AI writing toolsUpdated Checked examples: 9

Try
Probability
Probability: 0.166667
Maximum decimal places: 6; Nearest, ties away from zero
Exact fraction
1/6
Chance as 1 in N
1 in 6
As a percentage
16.6667%
Favourable outcomes
6
Equally likely outcomes
36

For 2 dice with 6 sides each, the sum is exactly 7 in 6 of 36 equally likely outcomes: 16.67% probability.

Sum of 2d6, highlighted: sum exactly 7

2: 0.0280.02823: 0.0560.05634: 0.0830.08345: 0.1110.11156: 0.1390.13967: 0.1670.16778: 0.1390.13989: 0.1110.111910: 0.0830.0831011: 0.0560.0561112: 0.0280.02812
How it's calculated S
  1. Equally likely outcomes

    SN=62=36S^N = 6^{2} = 36
  2. Count the sums

    #{T=7}=6\#\{T = 7\} = 6

    Counts come from convolving one die's distribution N − 1 times in exact integers (each new die adds a sliding window of S counts).

  3. Probability

    P=16=0.166666666667P = \frac{1}{6} = 0.166666666667

About the dice, coin and card probability calculator

Dice sums are counted exactly: one die's outcomes are convolved N − 1 times, so all Sᴺ rolls of N dice with S sides are counted rather than simulated. Heads in coin flips follow the binomial distribution, and runs of heads use Feller's recurrence for success runs. Card draws use the hypergeometric distribution, because each card leaves the deck, and poker hands are counted over all 2,598,960 five-card hands.

The default, two six-sided dice summing to 7, is the most likely total: 6 of the 36 rolls, a chance of 1/6. With three dice, a sum of at least 11 comes up exactly half the time, 108 of 216 rolls, and 3 or more heads in a row turn up in 50.8% of 10-flip sequences.

The results assume fair dice, independent flips and a well-shuffled deck; for a biased coin, enter its chance of heads. Answers are exact fractions unless the numbers grow too large. In the formulas T is the dice sum, Wₜ counts rolls giving sum t, S is the sides per die, N is the dice count, X counts special cards, D is deck size, K is the number of special cards and n is the draw size; R is the longest heads run.

How to calculate dice probability

Divide the rolls that give the result by all equally likely rolls; N dice with S sides have Sᴺ ordered outcomes. Two six-sided dice have 6² = 36, and six sum to 7: (1, 6), (2, 5), (3, 4) and their reverses. So P(sum = 7) = 6/36 = 1/6, about 16.67%.

The 11 possible sums are not equally likely, because each needs a different number of rolls. For two dice:

  • 2 or 12: 1 roll each, 1/36 = 2.78%
  • 3 or 11: 2 rolls each, 2/36 = 5.56%
  • 4 or 10: 3 rolls each, 3/36 = 8.33%
  • 5 or 9: 4 rolls each, 4/36 = 11.11%
  • 6 or 8: 5 rolls each, 5/36 = 13.89%
  • 7: 6 rolls, 6/36 = 16.67%

Three or more dice

With three dice there are 6³ = 216 rolls, and the peak moves to 10 and 11, each made by 27 rolls, or 12.5%. Sums from 3 to 18 are symmetric around 10.5, so a sum of at least 11 comes up 108 times in 216, exactly half.

For four dice, 595 of the 1,296 rolls total between 10 and 14 inclusive, a probability of 595/1296 = 0.4591. "At least" and "at most" include the target, and a range includes both ends.

Coin flips: how many heads?

A count of heads ignores where they fall, so it follows the binomial formula: P(k heads in n flips) = C(n, k) × pᵏ × (1 − p)ⁿ⁻ᵏ (NIST).

For a coin that lands heads 60% of the time, exactly 3 heads in 5 flips has probability C(5, 3) × 0.6³ × 0.4² = 10 × 0.216 × 0.16 = 0.3456.

With a fair coin, 10 heads in a row has probability (1/2)¹⁰ = 1/1,024, about 0.098%. Any other specific sequence of 10 flips, such as HTHTHTHTHT, is exactly as unlikely.

After 9 heads in a row, the 10th flip is still 50% heads, since flips are independent. Expecting tails to be "due" is the gambler's fallacy.

Streaks: heads in a row

A run of 3 heads somewhere in 10 fair flips is far more likely than 3 heads in one fixed spot (1/8). It turns up in 520 of the 1,024 possible sequences, a probability of 65/128 = 50.78%, because the run can start at any of 8 positions.

Those positions overlap, so the answer is not 8 × 1/8 = 1; sequences with overlapping or repeated runs would be counted several times. The exact count uses Feller's recurrence for success runs.

Streaks grow common in longer sequences. In 100 fair flips, a run of at least 5 heads appears with probability 81.0%, and a run of at least 7 with probability 31.8%. A streak alone is weak evidence that a coin is biased.

Drawing cards without replacement

Drawing n cards from a deck of D that holds K special cards gives P(exactly k special) = C(K, k) × C(D − K, n − k) ÷ C(D, n), the hypergeometric distribution. One card from a full deck is an ace with probability 4/52 = 1/13, about 7.69%.

For at least one ace in a 5-card hand, subtract the chance of none: 1 − C(48, 5)/C(52, 5) = 18472/54145 = 34.12%. Exactly two aces has probability 3.99%, and at least one heart (K = 13) has probability 77.85%.

Each ace drawn lowers the chance that the next card is an ace. Treating the five cards as independent draws with p = 1/13 gives 32.98%, not 34.12%.

Poker hand probabilities

Of the 2,598,960 possible five-card hands, 4 are royal flushes (1 in 649,740), 624 are four of a kind (1 in 4,165) and 3,744 are full houses (about 1 in 694). One pair turns up in 42.26% of deals, and 50.12% of hands hold nothing better than a high card.

Each hand counts in one category only. Royal flushes are separate from other straight flushes, and straight flushes are excluded from flushes and straights.

These are frequencies of the first five cards dealt, with no jokers, wild cards, draws or community cards. They are not the chance of winning a hand against other players (Grinstead and Snell cover the counting).

Dice, coin and card examples

ScenarioProbability
Default0.166666667
Three dice upper0.500000000
Four dice range0.459104938
Fair run0.507812500
Ace in five0.341158002
Poker royal0.000001539

"Default" is two dice summing to 7 and "Three dice upper" a sum of at least 11 on three dice. "Four dice range" is 10 to 14 on four dice and "Fair run" at least 3 heads in a row in 10 flips. The last two rows are the ace hand and a royal flush.

Inputs worth checking

  • Chance of heads is a decimal from 0 to 1: 0.6 for 60%, not 60.
  • Special cards are whatever counts as a success, such as 4 aces, 13 hearts or 12 face cards.
  • The model assumes fair dice, independent flips with a fixed chance of heads and a well-shuffled deck.

For other binomial and hypergeometric questions, use the binomial and Poisson distribution calculator. When outcomes come with payoffs, the expected value calculator gives the average result per play.

Worked examples

Two dice sum to 7 (defaults)

Game
Dice
Number of dice
2
Sides per die
6
Sum is
Exactly
Target sum
7
Probability
0.166667
Exact fraction
1/6
Favourable outcomes
6
Equally likely outcomes
36

Checked against: 6 of the 36 ordered rolls give 7 (standard two-dice table)

Three dice sum to at least 11

Game
Dice
Number of dice
3
Sides per die
6
Sum is
At least
Target sum
11
Probability
0.5
Exact fraction
1/2
Favourable outcomes
108

Checked against: Brute force over all 216 rolls of 3d6: 108 have sum ≥ 11 (symmetry about 10.5)

Four dice sum between 10 and 14

Game
Dice
Number of dice
4
Sides per die
6
Sum is
Between
Lowest sum
10
Highest sum
14
Favourable outcomes
595
Exact fraction
595/1296

Checked against: Brute force over all 1296 rolls of 4d6

Run of 3 heads in 10 fair flips

Game
Coins
Number of flips
10
Chance of heads
0.5
Heads
A run of heads in a row
Run of at least
3 heads
Probability
0.507813
Exact fraction
65/128
Favourable outcomes
520

Checked against: Brute force over all 2¹⁰ sequences: 520 contain HHH

Questions

What is the most likely sum when rolling two dice?

7, which 6 of the 36 equally likely rolls produce (1+6, 2+5, 3+4 and their reverses), a probability of 1/6 or 16.67%. The extremes 2 and 12 each need one exact roll, 1/36 or 2.78%. With three dice the peak shifts to 10 and 11, each 27 of 216 rolls, or 12.5%.

What are the odds of flipping heads 10 times in a row?

1 in 1,024 with a fair coin, because each flip halves the chance: (1/2)¹⁰ = 1/1,024, about 0.098%. After 9 heads in a row, the 10th flip is still 50% heads, since flips are independent; expecting tails to be "due" is the gambler's fallacy. Any other specific sequence of 10 flips, such as HTHTHTHTHT, is exactly as unlikely.

What are the odds of each poker hand?

Of the 2,598,960 five-card hands, 4 are royal flushes (1 in 649,740), 624 are four of a kind (1 in 4,165) and 3,744 are full houses (about 1 in 694). One pair turns up in 42.26% of deals, and 50.12% of hands hold nothing better than a high card. These are standard counts for the first five cards dealt, with no draws or community cards.

What is the probability of drawing an ace from a deck?

4/52 = 1/13, about 7.69%, for one card from a full 52-card deck. For at least one ace in a 5-card hand, subtract the chance of none: 1 − C(48, 5)/C(52, 5) = 34.12%. Cards drawn without replacement follow the hypergeometric distribution, so each ace drawn lowers the chance that the next card is an ace.

How likely is a streak of heads in a row?

More likely than most people guess. In 10 fair flips there is a 65/128 = 50.78% chance of at least one run of 3 or more heads, because a run can start at any of the 8 positions from flip 1 to flip 8. Long real sequences therefore contain streaks, and a streak alone is weak evidence that a coin is biased.

About this calculator

P(T=t)=WtSN,P(X=k)=(Kk)(D−Kn−k)(Dn)P(T = t) = \frac{W_t}{S^N},\qquad P(X = k) = \frac{\binom{K}{k}\binom{D-K}{n-k}}{\binom{D}{n}}

Sources

  1. Feller, An Introduction to Probability Theory and Its Applications, Vol. 1, 3rd ed. — §XIII.7 (success runs) and §II.6 (hypergeometric)
  2. Wikipedia — Poker probability: frequency of 5-card poker hands
  3. NIST/SEMATECH e-Handbook of Statistical Methods, §1.3.6.6.18 Binomial distribution

Checked against references

This calculator includes 9 worked examples with independently sourced answers. They run in the test suite, and you can run them here too.

Put this calculator on your site

Paste this where you want the calculator to appear. It is free to use, it stays in step with corrections made here, and the credit line below it links back so your readers can find the full version.

Height
Preview the embed

Keep the credit line. It is the only condition, and it is what keeps these calculators free.