Random Number Between 1 and 52

Generate a random whole number from 1 to 52, for drawing one card from a standard 52-card deck.

Press Generate for a random number between 1 and 52, ends included.

Odds for numbers between 1 and 52

Possible numbers52
Chance of any one number1 in 52 (1.9%)
Average result over many picks26.5
Even / odd numbers26 even, 26 odd

One number for one card, or one week

A standard deck has 52 cards, so each number can stand for one card once you've agreed on an order. A year also has 52 full weeks plus one day (two in a leap year), so the same range picks a random week of the year.

A simple numbering makes any result easy to read: 1 to 13 are spades from ace to king, 14 to 26 hearts, 27 to 39 diamonds and 40 to 52 clubs. To decode a number, divide by 13 and round up for the suit (1 is spades, 4 is clubs). The remainder gives the rank, with 0 meaning king.

Drawing cards with and without replacement

Cards drawnChance of a repeat (repeats allowed)Different sets (no repeats)
21.9%1,326
35.7%22,100
518.0%2,598,960
1060.3%15,820,024,220
2599.91%477,551,179,875,952
50over 99.99%1,326

Put each card back before the next draw and a repeat is more likely than not by draw 9 (52.0%), the card version of the birthday problem. Seeing all 52 cards that way takes 236 draws on average. Without replacement (No repeats ticked), the right-hand column counts the possible hands.

Card odds with a number from 1 to 52

If each number stands for one card in a standard deck, one pick gives you these odds:

To deal a poker hand, ask for 5 numbers with No repeats ticked. There are 2,598,960 different five-card hands, and each one is equally likely.

Ask for all 52 numbers with No repeats ticked and you get a complete shuffled deck. A deck can be arranged in 52 × 51 × 50 × … × 1 different orders, which is about 8.0 × 1067, and the generator can produce any of them.

Waiting for one card

Chance of having seen itDraws needed (card goes back)
50%36
90%119
99%238

Shuffling the card back in each time, half of all searches find it within 36 draws. No more than 1 in 10 takes longer than 119.

Counting 1,000 results

Out of 1,000 picks with repeats allowed, each card averages 19.23. Counts between 11 and 28 cover at least 95% of cases, so uneven totals are normal.

Five-card poker hands

Deal 5 numbers with No repeats ticked and read them as cards. Out of 2,598,960 possible hands:

HandWaysChance
Straight flush (including royal)401 in 64,974
Four of a kind6241 in 4,165
Full house3,7440.14%
Flush5,1080.20%
Straight10,2000.39%
Three of a kind54,9122.1%
Two pair123,5524.8%
One pair1,098,24042.3%

One pair or better turns up in 49.9% of hands, so about every other deal. In blackjack, a natural (an ace plus a 10, jack, queen or king as your first two cards) comes up 4.83% of the time from a single deck. As a week picker, note that some years have 53 weeks in the ISO 8601 calendar, so check which numbering your planner uses.

How deep until the first ace?

Shuffle the full deck (all 52 numbers, No repeats) and count down from the top. On average, you'll find:

Card you're afterMatching cardsAverage position
The first ace410.6
The first face card124.1
The first heart133.8
One named card126.5

The rule is simple. With k matching cards in a deck of 52, the first one sits at position 53 ÷ (k + 1) on average. A named card, like the queen of hearts, is equally likely to be anywhere, so it averages the middle of the deck. Aces turn up sooner because there are four of them to find.

How the number is picked

Your browser's Web Crypto API supplies a 32-bit random value (4,294,967,296 possibilities). Dividing by 52 leaves 48 spare values that would tilt the odds toward the lowest 48 numbers, so the generator discards them and draws again (1 time in 89,478,485).

Frequently asked questions

What are the odds of drawing the ace of spades?

1 in 52 (1.92%) on one draw. Deal 5 cards with No repeats ticked and it's among them 5 times in 52 (9.6%).

How do I pick a random week of the year?

Pick a number from 1 to 52. Some years have a 53rd week in ISO 8601 numbering, so check your planner before treating week 52 as the last.