Secret Santa Generator
Enter the names, add any pairs who should not draw each other, and get a random gift-exchange draw in which nobody draws themselves. Matches stay hidden until you reveal them, and you can copy a private message for each person. Nothing is sent, saved or emailed. Free, no sign-up.
Everyone who gives and receives a gift. Up to 100 names; each name must be different.
One rule per line. “Ana, Ben” means neither draws the other — use it for partners or siblings. “Cleo > Dev” means only that Cleo does not draw Dev — use it for last year’s match.
Everything happens in this page. No names are sent, saved or emailed — you pass each person their match yourself.
Your draw
Add at least two names, then press Draw names.
How to Use the Secret Santa Generator
- 1. List the names. One per line. Use a different name for each person; add a surname or initial if two people share a first name.
- 2. Add rules if you need them. Write Ana, Ben to stop two people drawing each other, such as partners. Write Cleo > Dev to stop only Cleo drawing Dev, which is how you avoid repeating last year’s match.
- 3. Choose swaps or not. Tick No swaps if you do not want two people to give to each other.
- 4. Draw. Add an optional note, such as the budget and the date. Matches are hidden; press Show to see one or Copy message for… to paste a private message into a chat or email to that person.
- 5. Draw again if you wish. Each press is a new, independent draw.
How the Draw Works
A valid Secret Santa draw is a derangement: a way of giving every person exactly one recipient, and every person exactly one giver, with nobody drawing themselves. Pulling names from a hat produces one by trial and error, because a person may pull their own name and the hat has to be shuffled again. The tool does the same thing, but faster and without bias: it shuffles the list with the Fisher–Yates algorithm and the browser’s cryptographic random source (crypto.getRandomValues), rejects any shuffle that breaks a rule, and tries again. Every valid draw is equally likely.
With no rules, about 36.8% of shuffles pass — the proportion approaches 1/e as the group grows — so a draw takes fewer than three tries on average.
| People | Possible draws (no one draws themselves) | Of which, with no swaps |
|---|---|---|
| 2 | 1 | 0 |
| 3 | 2 | 2 |
| 4 | 9 | 6 |
| 5 | 44 | 24 |
| 6 | 265 | 160 |
The table shows why very small groups are awkward: with two people the only draw is a swap, and with four people a third of all draws are two swapping pairs. A draw with no swaps needs at least three people.
When No Draw Is Possible
Rules can make a draw impossible, and a hat cannot tell you that. Before drawing, the tool checks whether any assignment exists, and if none does it names the people responsible. In a group of three, if Ana cannot draw Ben or Cleo, Ana has nobody to give to. More subtly, if Ana, Ben and Cleo may all only give to Dev, three givers are competing for one recipient. The message lists the givers and the recipients they are limited to, so you know which rule to remove.
If the rules are so tight that ordinary shuffling keeps failing, the tool switches to a randomised search that is guaranteed to find a draw when one exists. It tells you when it has done this, because that kind of draw is valid but not perfectly uniform.
Running the Exchange
- Set a budget and a date first. Put them in the note so every message carries them. A shared limit keeps the exchange fair.
- Keep the organiser’s view private. The person who runs the draw sees the matches. If that is a problem, ask someone who is not taking part, or use the hidden view and share only each person’s own message.
- Ask for wish lists. A line or two on interests, sizes or things to avoid helps givers who do not know the recipient well.
- Plan for a drop-out. If someone leaves, run a fresh draw rather than patching the old one, which could leave someone with no giver.
- Looking for a different format? In a white elephant or Yankee swap, people pick from a pile in turn; the Random Name Picker sets the order.
Frequently Asked Questions
- How does a Secret Santa generator make sure nobody gets themselves?
- It builds a table of who may give to whom, which excludes each person themselves, and only accepts a shuffle in which every giver lands on an allowed recipient. A person can therefore never be matched to their own name.
- How do I stop couples from drawing each other?
- Add a rule with their names separated by a comma, such as Ana, Ben. Neither will draw the other. Add one line for each couple or family pair.
- How do I avoid the same pairs as last year?
- Add last year’s matches as one-way rules, with a > between giver and recipient — for example, Cleo > Dev. Only Cleo is barred from drawing Dev; Dev may still draw Cleo. Use a comma instead if you want to bar both directions.
- Are the names sent anywhere?
- No. The draw runs in your browser, and nothing is sent, saved or emailed. The tool cannot email people; you pass each person their message yourself, which is also why the matches stay hidden on screen.
- Why does it say my rules make a draw impossible?
- Some combination of rules leaves too few recipients for a group of givers. The message names that group and the only people they can draw. Remove one of their rules, or tick off No swaps if that is the cause.
- Is the draw fair?
- Yes. Every valid draw is equally likely when ordinary shuffling succeeds, which is almost always the case. In the rare tight-rule case the tool says that the draw came from a guided search and is valid but not perfectly uniform.