Skip to the page

Is the shuffle really random? We dealt 40 million hands to find out

Yes. We ran 40 million deals through every shuffle the game uses and checked them against the exact odds of a perfect shuffle. Every card showed up in every place, in every seat and as the starter just as often as it should, and one deal had nothing to do with the next.

Play a practice game

On this page
  1. The short answer
  2. How the cards are shuffled and dealt
  3. What we tested
  4. Could the tests miss a problem?
  5. The realistic shuffle is different on purpose
  6. Check a deal yourself
  7. For the technically minded

The short answer

  • Every card was equally likely to land in every one of the 52 places in the deck. A perfect shuffle puts a card in a given place 1.92% of the time, and we saw between 1.91% and 1.94%.
  • Your hand, the other hands and the starter all got every card equally often.
  • Dealt cards scored what the math says. Four dealt cards and the starter averaged 4.77 points, and the exact average is 4.77.
  • One deal tells you nothing about the next one.
  • We also ran three broken shuffles through the same tests, and every one of them failed, so the tests do catch a bad shuffle.

How the cards are shuffled and dealt

The computer shuffles the way you'd draw names from a hat. It picks one of the 52 cards at random for the first place in the deck, then one of the 51 left for the next place, and so on until the deck is full. Every possible order of the 52 cards is equally likely, and every hand starts from a fresh deck, so nothing from the last hand carries over.

Then the cards come off the deck: six to each player in a two-handed game, five in a three- or four-handed one. You cut for the starter yourself, by tapping a card in the fan, the same as cutting at a table. With a deck this well mixed it makes no difference whether the cards go around one at a time or a hand at a time.

The random numbers come from different places depending on the game. Online, the server and every player's device each put in a secret number, so nobody can pick the cards. Is online cribbage rigged? explains how that works. Against the computer, when you start the game online, your device and the server do the same. Offline, your device makes them on its own.

What we tested

The game has four ways of dealing, one for each kind of game, and we dealt 10 million hands through each of them:

  • Online games
  • Games against the computer, and the Daily
  • Online games from before deal proofs
  • Games against the computer played offline

For each one we asked 37 questions that a bug or a cheat would show up in, and compared every answer with the exact odds of a perfect shuffle. Where a card lands in the deck, which cards end up next to each other, who gets which card in two-, three- and four-handed games, how often the starter is each card, how often a hand holds a pair or a fifteen or a run or a flush, what hands and cribs score, and whether one deal has anything to do with the next. That's 148 checks in all, and none of them failed.

Online games, 10 million deals
What we checkedPerfect shuffleWhat we saw
Each card in each of the 52 places in the deck1.92%1.91% to 1.94%
Each card dealt into your hand11.54%11.51% to 11.57%
The starter is a jack (his heels)7.69%7.70%
Six dealt cards hold at least one pair65.5%65.5%
Average hand (four dealt cards and the starter)4.769 points4.770 points
Cards your hand shares with your last hand0.692 on average0.692 on average
Across all four ways the game deals, every card turned up in every place between 1.91% and 1.94% of the time.

The chart shows one of those checks. If the shuffle favored any card for the starter, one of these bars would stick out. Jacks matter most here, because a jack turned up as the starter is his heels, 2 points for the dealer.

How often the starter was each rank, over 10 million online deals. The dashed line is a perfect 4 in 52 (7.69%).
  1. A7.70%
  2. 27.68%
  3. 37.69%
  4. 47.70%
  5. 57.70%
  6. 67.69%
  7. 77.69%
  8. 87.69%
  9. 97.69%
  10. 107.69%
  11. J7.70%
  12. Q7.69%
  13. K7.69%

We tested the random numbers themselves too, with a standard set of tests from the US National Institute of Standards and Technology, the kind used to check the randomness in security software. All four kinds passed.

Could the tests miss a problem?

Ten million deals is enough to see a very small bias. A card that turned up in one place 1.1% more often than it should, 1.945% of the time instead of 1.923%, would have stood out.

To be sure the tests work, we fed them three shuffles that are broken on purpose, each one a mistake programmers really make, and all of them deal hands that look fine at a glance. Every one of them failed, between 13 and 22 of the 37 checks, after only 100,000 deals.

The realistic shuffle is different on purpose

When you set up a game you can turn on Realistic Shuffle. It's off unless you turn it on, and ranked games never use it. Instead of a fresh deck every hand, the cards are gathered up off the table, riffled twice, given a quick overhand shuffle and cut, the way most people shuffle at home. The dealer can tap Shuffle up to 5 times for more riffles, and you can pick how tidy the shuffler is: Careless, Casual (the usual) or Thorough.

That means some of the last hand survives into the next one, just like at a real table. In our test games, two cards from the same crib ended up in the same hand 1.6 times as often as they would with the normal shuffle. With all 5 extra riffles that fell to 1.1 times.

Start with a deck in order and shuffle it like an ordinary player. How many of the 51 pairs of neighbors are still side by side?
RifflesStill side by side
2 (no presses)25.7
319.5
414.8
511.3
68.7
76.8
The normal shuffle1.0

Two mathematicians, Dave Bayer and Persi Diaconis, worked out that it takes about 7 perfect riffles to mix a deck well. Real riffles drop cards in clumps, so even 7 leave more order behind than you'd think.

It barely changes the scores. We played 20,000 test games with each setting. The hands players kept (after throwing to the crib) averaged within 0.03 of a point of the normal shuffle's 6.48, the crib within 0.03, and the dealer's edge over the other player moved by less than 0.04. The riffles are made from the same secret random numbers as everything else, so nobody can tell ahead of time where the cards will go. The Shuffle Lab shows both shuffles card by card if you want to watch the clumps survive.

Check a deal yourself

You don't have to take our word for any of this. Most games come with a proof that the cards were locked in before the first one was dealt, and the app checks it for you. Look for “Deal proof verified” in the game log during a game, and “Game proof verified” in Cribbage Labs afterward. Check a deal yourself has the steps.

We tested that as well. We dealt 160,000 hands the way an online game does, then dealt every one again from the numbers its proof reveals. All 160,000 came out the same, card for card.

For the technically minded

The shuffle is Fisher-Yates. Verified online games draw from ChaCha20 keyed through HKDF-SHA-256 from every player's contribution and the server's; games with a deal proof and the Daily use SplitMix64; online games without a ceremony use Python's Mersenne Twister; offline games use mulberry32 on the device. Each was tested over 10 million deals with chi-squared tests against exact distributions (Holm-corrected, at 1%), and the raw output with nine of the NIST SP 800-22 tests. The realistic shuffle was measured against Bayer and Diaconis's exact riffle results. The browser, the apps and the server deal identical decks from the same numbers, which we checked deck for deck.

The offline generator starts from one of about two billion seeds, so it isn't built to keep secrets the way the online ones are. It passed every test, and in a game against the computer on your own phone there's nobody to keep a secret from.

Keep reading

See all guides

Ready for a game?

It’s free, it’s easy to pick back up, and there’s always a seat open at the table.

Start playing