Events and games

Secret Santa generator

Draw names for Secret Santa in your browser. No email, no sign-up, and nobody sees who got whom, not even you.

Worked example

8 people → 14,833 possible draws

Draw Secret Santa names without anyone peeking

  1. Paste the whole group in one go

    One name per line or separated by commas, so a list copied from a group chat works. It takes 3 people or more; 6 with no rules have 265 possible draws.

    Example Ana, Ben, Cat…
  2. Keep couples from drawing each other

    Tap Rules beside a name. Keeping Ana and Ben apart both ways leaves 168 of the 265 draws, and if a set of rules can’t work, it names the person causing it.

    Example Ana ✕ Ben
  3. Run the gifts round one big circle

    In one circle the gifts pass A → B → C and on back to A, with no closed little groups, so presents can be opened in turn. With the same rule, 72 draws fit.

    Example A → B → C → A
  4. Stop two people buying for each other

    No swaps throws out any draw where two people got each other. Every draw that fits is equally likely: names are shuffled with your browser’s secure random numbers.

    Example 96 draws fit
  5. Skip last year’s pairings next December

    A draw is saved only on the device that made it. Draw from the same phone or laptop at least 60 days later, and nobody gets the person they had last time.

    Example Same device, next year
  6. Send each person only their own match

    Each link opens one match, so nobody sees the whole draw, the organiser included. The budget, date and message ride in every link: changing them means resending, not redrawing.

    Example $25 limit

Watch: why 63% of hat draws need a redo, and the fair way to draw names

Recorded on this generator by Jeremiah Say, 1 Nov 2026 · 3:23 · no sound, captions on screen

What the video shows, in words
  1. 0:00 How often does someone draw their own name from a hat? With 8 people, 63% of the time. The names can come out 40,320 ways, and in only 14,833 of them does nobody hold their own name: 25,487 of 40,320 draws need a redo.
  2. 0:27 Does a bigger group make it better? No. A hat draw needs a redo 66.7% of the time with 3 people, 62.5% with 4, and about 63.2% from 5 people up (1 − 1/e). The generator shuffles with secure random numbers and throws away any shuffle that breaks a rule, so every draw that fits is equally likely.
  3. 1:02 How do you keep couples from drawing each other? Tap Rules and pick their partner. Six people have 265 possible draws; with three couples kept apart, 80 remain. Four people in two couples leave just 4, so everyone can guess.
  4. 1:45 Why can’t a draw work with my rules? A couple and one friend: the couple can only buy for the friend, and two people can’t both buy for one. A draw exists exactly when every group may buy for at least as many people as are in it (Hall’s theorem, 1935). Add a person and it works again.
  5. 2:18 How does each person see only their own match? Each person gets a private link. The draw sits after the # in the link, which browsers never send to a server, so nobody sees who got whom, not even the organiser.
  6. 2:46 Is the count of possible draws right? It matches the published count of draws where nobody gets themselves (OEIS A000166) for 3 to 10 people: 14,833 for 8. Next year, a switch keeps everyone off last year’s match.

Watch on YouTube (opens in a new tab)

Events and games: 6 more videos

Why drawing names from a hat goes wrong

When everyone draws from a hat at once, someone usually pulls their own name. With 8 people there are 40,320 ways the names can come out, and only 14,833 of them have nobody holding their own name. So 63.2% of hat draws need a redo. The chance barely changes with the size of the group: from 5 people up it stays at about 63.2% (it settles at 1 − 1/e).

A redo is not only slow. When the last person draws and only their own name is left, everyone has to start again, and the people who already looked know who they had. This generator never deals a draw where anyone has themselves.

PeoplePossible drawsAs one big circle
322
496
54424
6265120
71,854720
814,8335,040
9133,49640,320
101,334,961362,880
12176,214,84139,916,800
Possible draws are derangements (OEIS A000166); one big circle is (people − 1)!. A hat draw needs a redo 66.7% of the time with 3 people and about 63.2% from 5 up. Worked out by the same code that runs the generator.

How the draw stays fair

The names are shuffled with your browser’s secure random number generator, the same one used for encryption. If a shuffle breaks any rule, it is thrown away and the names are shuffled again. Because every shuffle is equally likely and only the good ones are kept, every draw that fits your rules is equally likely too.

The result card says how many possible draws fit your rules, counted exactly for up to 16 people (9 with No swaps on). Open Show the math to see the count for your own group.

When a draw is impossible

Some sets of rules leave no possible draw. Other generators just fail. This one tells you who causes it, for example: “Ann and Ben can only buy for Cat: 2 people, 1 person to buy for.” Two people can’t both buy for the same one person, so one of those rules has to go.

The check comes from Hall’s marriage theorem (Philip Hall, 1935): a draw exists exactly when every group of people is allowed to buy for at least as many people as are in the group.

Couples, swaps and one big circle

Rules cost fewer draws than people expect. Six people have 265 possible draws. Split them into three couples who can’t draw each other and 80 remain, still plenty to keep it a surprise. With only two couples, though, just 4 draws are left, so each person can make a fair guess.

  • No swaps stops two people buying for each other. With 8 people, 8,988 of the 14,833 possible draws have no swaps.
  • One big circle sends the gifts round the whole group in one loop, so you can open them in turn: Ann gives to Ben, Ben to Cat, and so on back to Ann. With 8 people there are 5,040 possible circles.

Keeping it secret

  • Nobody sees the whole draw. After you press Draw names, the page shows who has a link, not who got whom. If you are only organising, I’m not taking part: show every match lists them.
  • Each link shows one match. It opens a card that says who that person is buying for, with the budget, date, message and any gift hint for their person.
  • The draw lives in the links, not on a server. Everything sits after the # in each link. Browsers never send that part to a server, so Toggle9 never receives the names. The names are scrambled so they don’t show in a chat preview, but this is not encryption: someone who opens another person’s link will see that match.
  • Your organiser link holds the whole draw. Keep it to resend a lost link. Don’t post it in the group chat.
  • Changed the budget, date or message after sending? The matches stay the same: the page lists whose links show the old details, so you can send just those again.

Avoiding last year’s match

After a draw, this browser remembers who had whom. When you open the generator with the same group 60 days or more later, a switch appears: Nobody gets the same person as the draw on that date. It is on by default. Draws on the same device in the same weeks don’t count, so redrawing this year’s exchange is never blocked. Each year it compares with the exchange just before, not the first one it saw. Clear saved data removes the memory.

Draw counts matched to OEIS A000166

A Secret Santa draw where nobody gets themselves is what mathematicians call a derangement, and the OEIS lists how many there are for each group size. The draw counter here works through every allowed pairing, and its count for 3 to 10 people must match the published sequence. Last run 19 November 2026.

ExampleWhere it’s printedThe source’s answerThis calculator
3 people, no other rules: possible drawsOEIS A00016622
4 people, no other rules: possible drawsOEIS A00016699
5 people, no other rules: possible drawsOEIS A0001664444
6 people, no other rules: possible drawsOEIS A000166265265
8 people, no other rules: possible drawsOEIS A00016614,83314,833
10 people, no other rules: possible drawsOEIS A0001661,334,9611,334,961

Questions

Can the organiser take part?

Yes. Add yourself like everyone else. After the draw the page never shows who got whom, so you find out your own match the same way as everyone else, from your own link.

What if someone loses their link?

Open the generator again from the same browser (the draw is in the page’s link and in Recent) and send that person’s link again. It is the same match. Don’t press Draw again: a new draw changes everyone’s match.

What if we draw in person?

Choose Print fold-over cards. Each card has a name on the outside and their match on the inside, upside down, so it can be folded and handed over without anyone seeing.

Can people read their match in another language?

Yes, in Spanish, French or Portuguese. Each link opens in the language the person’s phone or browser is set to, so a cousin in Mexico sees Tu amigo secreto es while you wrote the draw in English, and one tap switches the card back to English. Names, the budget and your message appear exactly as you typed them. This page, where you set up the draw, is in English.

Is there a limit on numbers?

Up to 100 people. Draws for any size take a moment. The exact count of possible draws is shown for groups of up to 16 (up to 9 with No swaps on), beyond which it gets very large.

Sources

How sources are chosen and checked: editorial policy · these sources in the library, with the other tools that use them

Scroll to Top