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

Every assignment is on screen at once, so whoever presses the button knows the whole draw. Have a non-participant run it, or send each person their own line and accept that the organiser knows.

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.