Secret Santa Generator
Enter at least 3 participant names (one per line) to generate a random Secret Santa assignment. The algorithm guarantees nobody draws their own name.
How the draw is made
Names are split on line breaks, trimmed, and blank lines dropped. The list is then shuffled with Sattolo's algorithm, which differs from an ordinary shuffle in one detail - the swap partner is drawn from strictly below the current position:
for i = n-1 down to 1:
j = random integer in [0, i) // never j = i
swap slot i and slot j
person i gives to names[slot i]
That single restriction forces the result into one closed loop through everyone: Alice gives to Carol, Carol gives to Dave, Dave gives to Bob, Bob gives back to Alice. Nobody draws themselves, everybody gives once and receives once, and with six names there are 5! = 120 equally likely arrangements.
What the single loop buys and costs
- No reciprocal pairs. A plain derangement can hand you Alice-Bob and Bob-Alice, which drains the mystery from two people at once. One loop cannot produce that.
- Three people minimum. Two names would leave only the mutual swap, so the tool refuses fewer than three.
- No exclusions. There is no way to keep a couple or two siblings apart; if the draw pairs them, press Generate again.
- Duplicates are not detected. Two people called Alex both appear, so add a surname or initial.
Frequently asked questions
How does Secret Santa work with only 3 people?
Three names give exactly two possible draws, the two directions round the circle. Everyone still buys one gift and receives one, and nobody can end up with their own name.
Can two people be assigned to each other?
No. The draw is one loop through the whole group, so a gift never comes straight back. If you want mutual pairs allowed, this is not the tool.
Can I redraw if I do not like the result?
Yes - press Generate Assignments again and a fresh loop is made. Nothing is saved between draws, so copy or screenshot the list you intend to use before you reload the page.