Secret Santa generator

Type the names and draw who buys for whom. Nobody gets themselves, guaranteed.

How the draw works

The tool shuffles the list of names using your browser's cryptographic random number generator (crypto.getRandomValues, the same source used for encryption keys), then checks whether anyone has drawn themselves. If anyone has, it quietly shuffles again and rechecks, repeating until nobody is buying their own present. Mathematicians call an arrangement like this a derangement: a shuffle with no name left in its original position. Because every shuffle is equally likely and invalid ones are simply thrown away, every valid outcome is equally likely too, so the draw is as fair as pulling names from a hat, minus the risk of someone pulling their own and having to start over in front of everyone.

Nothing is uploaded. The names, the shuffling and the results all stay in your browser, and refreshing the page clears both the list and the pairs.

valid draws for n people ≈ n! ÷ e  (about 37% of all shuffles)

The maths of the draw

3 people: Alice, Ben, Chloe
There are 6 possible shuffles but only 2 valid ones: Alice → Ben → Chloe → Alice, or Alice → Chloe → Ben → Alice. So 2 in 6 shuffles work, about 33%.
4 people
24 possible shuffles, of which 9 leave nobody with themselves: 9 ÷ 24 = 37.5%. On average the tool needs two or three attempts to land on a valid draw, which happens in a blink.

As the group grows, the share of valid shuffles settles at 1 ÷ e, roughly 36.8%, no matter how many people join. That is why the retry approach stays fast for a family of five or an office of fifty.

How to run a fair Secret Santa

  • Collect names by a deadline. Late November works well for a December exchange, leaving time to shop.
  • Agree the budget up front. Somewhere around £10 to £15 is typical for offices; the exact figure matters less than everyone knowing it. Decide too whether joke gifts are welcome.
  • Run the draw once. One organiser pastes the names, clicks draw, and copies the pairs. No redraws because someone got a person they find hard to buy for; that is half the fun.
  • Tell people privately. Message each person only their own line, then delete the copied list. Announcing the full list in a group chat defeats the point.
  • Set the exchange date and rules. Wrapped, labelled with the recipient only, and nobody confesses until after the unwrapping.

Keeping it secret

Whoever clicks the button sees every pair, so choose your organiser accordingly. The tidiest options are asking someone who is not taking part to run the draw, or picking an organiser who does not mind knowing. If you want to stop couples or housemates drawing each other, run the draw again until the pairs work, before anything is sent out; the tool does not enforce exclusions itself. And if you only need one overall winner rather than a full exchange, the wheel spinner is the simpler tool for the job.

Frequently asked questions

Can two people end up buying for each other?

Yes. The only rule the draw enforces is that nobody gets their own name, so mutual pairs happen naturally, especially in small groups (with two people it is the only possible outcome). If your group prefers to avoid swaps, simply draw again before announcing anything.

How do I keep the results secret?

The person who runs the draw sees every pair, so either pick an organiser who is happy knowing, ask someone outside the group to click the button, or have the organiser copy the list and message each person only their own line. Once sent, delete the copied list.

Is the draw fair?

Yes. The names are shuffled with your browser's cryptographic random number generator and reshuffled until nobody has themselves. Every valid arrangement is equally likely, so no one is more likely to draw any particular person than anyone else.

How many people do I need?

At least two, though it only becomes a proper Secret Santa from about four, since with two or three people it is easy to work out who has you. There is no upper limit that matters for an office or family draw.

Are the names sent anywhere?

No. The draw runs entirely in your browser, nothing is uploaded, and refreshing the page clears both the names and the results.

Related tools