Tool
Card Deck Shuffler
Shuffle a standard 52-card deck and deal hands — with the 52! number made concrete.
Card Deck Shuffler
Shuffle a standard fifty-two card deck and deal up to eight hands. The shuffle is a single Fisher-Yates pass, which is genuinely unbiased in a way that riffling a physical deck seven times is not quite.
The number worth pausing on is 52 factorial: about 8 followed by 67 zeros. The ordering this page just produced has, with overwhelming probability, never existed before and will never exist again.
That claim gets made a lot and it is worth checking. If every person who has ever lived shuffled a deck every second for the entire age of the universe, they would collectively have produced a vanishing fraction of one percent of the possible orderings.
How the Card Deck Shuffler works — and why it's fair
The shuffle walks the deck from the last card to the first, swapping each card with a uniformly chosen card at or before its position. That is Fisher-Yates, and it produces every one of the 52 factorial orderings with exactly equal probability using exactly 51 swaps.
The correctness argument is short enough to state. On the first step, every one of the 52 cards has an equal chance of landing in the last position. On the second, every one of the remaining 51 has an equal chance of the second-to-last position. Multiply that down and every ordering has probability 1 divided by 52 factorial. The common bug is choosing the swap partner from the whole deck rather than from the unprocessed remainder, which quietly makes some orderings more likely than others.
Each swap index comes from crypto.getRandomValues with rejection sampling, so there is no modulo skew at any position. That matters more than it sounds at 52 cards: a naive remainder over a range of 52 would slightly favour low indices at every one of the 51 steps, and the biases compound.
Dealing takes cards from the front of the shuffled deck in blocks, exactly as a physical deal does. Since the deck was uniformly shuffled, any deal from it is a uniformly random deal — dealing one card to each player in rotation, as a real dealer does, produces exactly the same distribution as dealing five consecutive cards to each, which is a fact that surprises people at card tables regularly.
The remaining deck is reported so a partial deal is visible as a partial deal. Nothing is held back, and the cards not dealt are simply the tail of the same shuffled ordering.
A physical shuffle is a useful comparison. Seven riffle shuffles are the standard figure for adequately randomising a deck, and fewer than that leaves detectable structure from the previous order — which is why casinos machine-shuffle. A Fisher-Yates pass has no such gradient: it is either done or not done, and after one pass the deck is exactly uniform.
When the Card Deck Shuffler is fair — and when it is not
What it does guarantee
- Every one of the 52 factorial orderings is exactly equally likely, with no ordering favoured or unreachable.
- Each swap index is drawn with rejection sampling, so there is no accumulated remainder skew across the 51 swaps.
- Dealing from a uniformly shuffled deck is uniform, whichever pattern you deal in.
What it does not
- It does not track what has been dealt across shuffles. Every shuffle starts from a full fresh deck.
- It knows nothing about card games — it will happily deal thirteen cards to eight players and run out.
- The deck is standard 52 with no jokers, and the composition is not configurable.
Two worked examples
Five cards to four players
- 20 cards dealt, 32 remaining in the deck.
- Each player's hand is a uniformly random 5-card selection; there are 2,598,960 possible 5-card hands.
- Dealing in rotation or in blocks gives the identical distribution, because the deck was already uniform.
One full shuffle, no deal
- 51 swaps, one per card from the bottom up.
- The resulting ordering is one of about 8 × 10⁶⁷ equally likely possibilities.
- That is more orderings than there are atoms in the observable universe, by roughly a factor of a billion.
When a digital deck is the better one
Card games without cards are the direct case — a group that wants to play something and does not have a deck, or a remote game where one person deals and reads the hands out. The deal is verifiable in a way a physical remote deal is not.
Teaching probability with cards is the other main use, and the fifty-two factorial figure is one of the most effective single numbers in the subject. It makes the abstraction of a large combinatorial space concrete in a way that dice cannot, because everyone has held a deck.
Card magic and puzzle construction use it for setup rather than performance: generating a genuinely random starting order to test whether an effect survives one, which is exactly what a hand shuffle cannot reliably provide.
For shuffling a list that is not cards, the order randomizer runs the same Fisher-Yates pass over whatever you paste in. For a shuffle with a constraint — no two adjacent entries sharing a property — the playlist shuffler handles that case, and the guide on how shuffling works covers the algorithm in full.
Frequently asked questions
Is one Fisher-Yates pass really enough?
Yes. Unlike a physical riffle, it does not improve with repetition — after one complete pass every ordering is exactly equally likely, and a second pass changes nothing about that.
How many orderings are there?
52 factorial, about 8 × 10⁶⁷. The ordering you just produced has almost certainly never occurred before in the history of card playing.
What is the common bug in a hand-written shuffle?
Choosing the swap partner from the whole deck rather than from the unprocessed remainder. It still looks shuffled and it is measurably not uniform.
Does dealing in rotation differ from dealing in blocks?
No. Because the deck is already uniformly shuffled, any deal pattern gives the same distribution — which is why the argument at card tables about it is never worth having.
Are jokers included?
No, it is a standard 52-card deck. The composition is not configurable.
Does it remember cards dealt in a previous shuffle?
No. Each shuffle starts from a complete fresh deck, so it does not model a game played across multiple deals.
What if I ask for more cards than the deck holds?
It deals what it has. Eight hands of thirteen would need 104 cards, so the later hands come up short — the tool does not warn you.
How does this compare to shuffling by hand?
Seven riffle shuffles is the standard figure for adequately randomising a physical deck, and fewer leaves detectable structure. A Fisher-Yates pass has no such gradient.
Is the ordering stored anywhere?
No. It exists in the page until you shuffle again or leave, and nothing is transmitted.