Secret Santa Generator
One per line, or comma-separated. At least three people.
Enter at least three names, then draw.
The Secret Santa generator assigns each person someone else to buy for, guaranteeing nobody draws their own name. It uses the cycle method rather than shuffling until the result happens to work, which also removes mutual pairs, with three or more people, nobody buys for the person buying for them.
How it works
- Duplicate names are removed, because two identical entries would leave one person unassigned.
- The list is shuffled with Fisher-Yates using the browser cryptographic random source.
- Each person is assigned the next person in the shuffled order, and the last wraps around to the first.
- Assignments are hidden by default, so an organiser can send them out without seeing their own.
Arranging everyone in one loop is what guarantees a valid result in a single pass. The common alternative (shuffle, check for self-assignment, reshuffle) works but takes an unpredictable number of attempts and produces a biased distribution across possible derangements.
Examples
Four people
Names
Amara, Caleb, Delphine, Finn
Result
Amara → Finn, Finn → Caleb, Caleb → Delphine, Delphine → Amara
The four form a single loop. Nobody has themselves, and no two people have each other, Amara buys for Finn but Finn buys for Caleb, not back to Amara.
Three people, the smallest valid group
Names
Amara, Caleb, Delphine
Result
A three-person cycle, in a random rotation
Three is the minimum. With two people the only possible assignment is each buying for the other, which needs no tool.
Frequently asked questions
Can two people be assigned to each other?
No. The cycle method puts everyone in one loop, so A buys for B, B buys for C, and only the last person wraps back to the first. Mutual pairs are impossible with three or more people, which most simple shuffling approaches do allow.
Why does it need at least three people?
Because with two, the only arrangement where neither draws themselves is each drawing the other. There is exactly one possible outcome and nothing to randomise.
Why are the assignments hidden until I press reveal?
So the organiser can generate and send them without seeing their own. It is not real secrecy, anyone can press the button, but it means the person running the draw does not have their surprise spoiled by glancing at the screen.
Can I exclude specific pairings, such as couples?
No. Constrained assignment is a different and considerably harder problem, and a tool that silently failed to honour a constraint would be worse than one that never offered it. Draw again if a pairing does not work, or split the group.
Is my list of names stored anywhere?
No. Everything runs in the page and is lost when you close it. Nothing is uploaded and no assignments are emailed, which does mean distribution is up to you.