Back to the blog

Random

Draw a random playing card from a fair deck.

Draw cards from a fairly shuffled deck of 52, with jokers if you like, until it runs out. Why a computer shuffle is fairer than a few riffles.

By 3 min read

The Random number generator showing 42 in large figures, two dice showing four and three, and a coin showing heads

For a magic trick, a game night without cards or a quick decision, drawing from a virtual deck is as good as the real thing, and better shuffled.

A real deck, dealt from the top.

The deck is shuffled once and cards come off the top, so the same card never comes twice until you put the cards back. Turn on two jokers under More options for a deck of 54. The page says how many cards are left.

A shuffle where every order is as likely.

The deck is shuffled by the Fisher–Yates method with your browser's cryptographic generator, which gives every one of the 52! orders the same chance. By hand, a study of riffle shuffles found it takes about seven to mix a deck well.

Uses beyond games.

Draw a card to choose an exercise, a writing prompt or who goes first; red or black is a coin flip with a picture.

Further reading

Topics: pick a card · random card generator · draw a card · random playing card · card shuffler · shuffle a deck

A little less theory. A little more doing.

Try it on your own terms, with a free browser tool.

Try the tool