Secret Santa: How to Draw Names and Avoid Awkward Pairings
Shuffle everyone's names at random, check the draw against your rules, and throw the whole draw away and shuffle again if anyone gets themselves or breaks an exclusion. Repeating the full draw like this gives every valid arrangement the same chance, and it takes about 2.7 shuffles on average.
How does a fair Secret Santa draw work?
A fair draw is a random shuffle that is checked against your rules. Put everyone in a random order and give each person a match. Then check three things: nobody has themselves, nobody breaks an exclusion such as a couple, and nothing else you chose is broken, such as a direct swap. If any check fails, throw the whole draw away and shuffle again. Because you only ever keep draws that pass, every valid arrangement ends up with exactly the same chance.
Run a Secret Santa in five steps
- Collect the names
Get everyone's name and check the spelling. Three people is the minimum.
- Set the rules before drawing
Decide who must not draw each other, whether to avoid direct swaps, and agree the budget and date.
- Shuffle and check
Shuffle everyone at random, then check the draw against every rule. If any rule is broken, throw the whole draw away and shuffle again.
- Reveal the matches privately
Give each person only their own match, by private link or by passing a device around, so nobody else sees it.
- Handle changes by redrawing
If someone drops out or joins, run a fresh draw and tell everyone to use the new result.
Which rules should you set before the draw?
Agree the rules before anyone sees a match. Rules decided afterwards can look like favouritism, because by then somebody is unhappy with who they got. There are four to settle: who is taking part, who must not draw each other, whether direct swaps are allowed, and the budget and date.
Direct swaps are a matter of taste. Some groups like the symmetry of two people buying for each other, and others find it less fun because there is less mystery. If you allow them, the draw is easier to complete. If you avoid them, it takes a few more shuffles, as the odds below show, but a computer makes that instant.
Write the budget and date into the invitation, and repeat them wherever each person receives their match, so nobody can claim they missed them.
Why redraw everything when someone draws themselves?
Starting the entire draw again is the only fix that is simple to prove fair. If you keep every valid draw and discard every invalid one, nothing favours one valid arrangement over another. Quick patches, such as swapping the unlucky person with a neighbour, are harder to reason about and are not guaranteed to give every valid arrangement the same chance.
The Secret Santa generator works this way. It shuffles everyone using your browser's secure random source, checks the result against your rules, and tries again if a rule is broken.
What are the odds a random shuffle works first time?
With 3 people, 2 of the 6 possible arrangements are valid, which is 33.3%. With 4 people it is 9 of 24, or 37.5%. From about 8 people the chance settles at 36.8% whatever the group size, which is 1 divided by the number e. That means a draw takes about 2.7 shuffles on average. A computer does this in a blink, but it is why drawing from a hat so often needs a redo.
If you also avoid direct swaps, where A gives to B and B gives to A, the chance for larger groups falls to about 22.3%, so a draw takes about 4.5 shuffles on average. With 3 people it changes nothing, because the only valid arrangements are 3-person loops.
| People | Nobody draws themselves | Also no direct swaps | Shuffles needed (no swaps) |
|---|---|---|---|
| 3 | 33.3% | 33.3% | 3.00 |
| 4 | 37.5% | 25.0% | 4.00 |
| 5 | 36.7% | 20.0% | 5.00 |
| 6 | 36.8% | 22.2% | 4.50 |
| 8 | 36.8% | 22.3% | 4.49 |
| 10 | 36.8% | 22.3% | 4.48 |
| 20 | 36.8% | 22.3% | 4.48 |
| Any larger group | 36.8% | 22.3% | 4.48 |
How many shuffles will your draw take?
Enter your group size to see the chance that one random shuffle is valid, and how many shuffles it takes on average.
How this is calculated: the chance that nobody draws themselves is 1 minus 1/1! plus 1/2! minus 1/3! and so on up to 1/n!. With direct swaps removed too, the same idea applies to arrangements that have no loop shorter than 3 people. The average number of shuffles is 1 divided by that chance.
How do you stop couples and family from drawing each other?
List each couple or family as a group that must not draw each other. Nobody in a group is matched with anyone else in the same group, in either direction. There is one limit: a group can have at most half of all the people. Everyone in a group has to give to someone outside it, and each outsider can receive only one gift, so a group of 5 needs at least 5 people outside it. With 8 people, no excluded group can have more than 4.
Is your draw possible with those exclusions?
Enter the group size and the size of your biggest "must not draw each other" group, such as a family.
How this is calculated: everyone in a group must give to someone outside it, and each outsider can receive only one gift, so the group can have at most half of all the people.
How do you keep Secret Santa secret?
The simplest way is to make sure nobody, including the organizer, sees the whole list of matches. The Secret Santa generator offers three ways to reveal results: private links, where each person opens their own link and taps Reveal; pass the device, where everyone taps their own name on one screen, reads their match and hides it again; and an organizer list for when you just need the pairings.
With private links, the match is carried inside the link itself, after the # sign. Browsers do not send that part of a link to a server. The link is not encrypted, though, so treat it like a private message and send it only to its owner. Anything you type into the budget, date and note boxes is included in every link, so each person sees it when they reveal their match.
Draw names with exclusions, an optional budget and private links in one go.
Open the Secret Santa generatorWhat should you check before and after the draw?
Secret Santa planning checklist
Work through these before and after the draw. Ticking is for your own tracking and nothing is stored.
Which Secret Santa myths are wrong?
Drawing names from a hat is fairer than using software.
Fairness comes from a random shuffle and a rule that throws out invalid draws, not from the hat. A hat can be perfectly fair, but it relies on people redoing the draw honestly when someone picks themselves. Software does that check every time.
If someone draws themselves, just swap them with a neighbour.
It works for a family game, but starting the whole draw again is the version that is easy to show is fair, because every valid arrangement then has exactly the same chance. Quick patches are not guaranteed to treat every arrangement equally.
The organizer has to know who has whom.
Not with private links. Each person opens their own link and sees only their own match, so even the organizer can enjoy the surprise.
The more people, the harder it is to get a valid draw.
For eight or more people, about 37 in 100 random shuffles are valid whatever the group size, so a draw takes under 3 shuffles on average whether you have 8 people or 80.
Questions people ask
How many people do you need for Secret Santa?
At least three. With two people the only possible draw is that each gives to the other, which defeats the point. The RandomlyHQ Secret Santa generator handles groups of 3 to 100 people.
How do you do Secret Santa without drawing from a hat?
Use a generator that shuffles and checks the draw for you, then share each person's match privately, either with one private link each or by passing a device around.
Can you stop couples from drawing each other?
Yes. List them as a group that must not draw each other. The biggest such group can have at most half of all the people, because everyone in it must give to someone outside it.
What if someone drops out after the draw?
Remove them and run the draw again, then send out new links. Old links still show the old match, so ask everyone to use the new one.
Is the Secret Santa draw really random?
Yes. Names are shuffled with your browser's secure random source, and any draw that breaks a rule is thrown away and shuffled again, so every valid arrangement has the same chance.
Sources and method
The odds are computed exactly with integer arithmetic and confirmed by checking every possible arrangement for groups of up to 8 people. The group-size rule was confirmed by checking every case for up to 7 people.