CompoundPage

Secret Santa Generator

The secret santa generator draws names so nobody gets their own, keeps couples apart, and gives every valid draw exactly the same chance.

Separate names with commas. 3 to 100 people, each name different.

Pairs joined by a hyphen, separated by commas. Type none for no exclusions.

Off: Ava-Ben means neither draws the other. On: Ava can't draw Ben, but Ben can still draw Ava.

Stops Ava drawing Ben while Ben draws Ava. Changes nothing for 3 people.

Added to each giver's message. Nothing is calculated from it.

Who gives to whomAva → Chloe | Ben → Dev | Chloe → Ben | Dev → Ella | Ella → Finn | Finn → Ava

People in the draw
6
Exclusions honored Ava and Ben.
1 pair, both ways
Two-person swaps
allowed
Budget
$30
Valid draws for this list Of the 720 ways to hand out 6 names, 168 give nobody their own name and honor every rule.
168 of 720 orders (23.33%)
Chance a plain shuffle gives nobody their own name 265 of the 720 orders of 6 names with nobody on their own name, before any exclusions.
36.81%
Method
shuffle and check, 1 try
Send each giver their own row only
GiverGives a gift toMessage for the giver
AvaChloeHi Ava, you're Secret Santa for Chloe. Budget: $30. Keep it secret!
BenDevHi Ben, you're Secret Santa for Dev. Budget: $30. Keep it secret!
ChloeBenHi Chloe, you're Secret Santa for Ben. Budget: $30. Keep it secret!
DevEllaHi Dev, you're Secret Santa for Ella. Budget: $30. Keep it secret!
EllaFinnHi Ella, you're Secret Santa for Finn. Budget: $30. Keep it secret!
FinnAvaHi Finn, you're Secret Santa for Ava. Budget: $30. Keep it secret!

How the Secret Santa Generator works

A secret santa name draw has one rule that matters: nobody may draw their own name. Each person buys one gift for one other person, everyone receives exactly one, and nobody knows who has them until the exchange.

An assignment where nobody gets their own name is called a derangement, and derangements are rarer than they look. Six names can be handed back in 720 different orders, and only 265 of them give nobody their own name: 36.81%. As the group grows, the share settles at 1/e, or 36.79%, the same constant as the classic hat-check problem. By 20 people it matches 1/e to 15 decimal places. So when a real hat goes round, about two draws in three put at least one person on their own name, and the whole hat has to go round again.

Exclusions are for people who shouldn't draw each other, usually couples and housemates who would buy for each other anyway. Each pair works both ways; a one-way exclusion, where Ava may not draw Ben but Ben may draw Ava, suits rules like "not the person you had last year". A household of three is three pairs. In the example, six people with one couple kept apart have 168 valid draws out of 720, 23.33%, and the generator picks one of those 168 at random.

Exclusions can make a draw impossible, and the generator names the people causing it. That happens in a group of any size when some set of people can only draw from fewer people than they number, and it is checked exactly before the generator gives up.

A two-person swap is Ava drawing Ben while Ben draws Ava. Swaps are allowed by default because they are part of a fair draw, but some groups find they feel like a pair rather than a secret. Ruling them out drops the six-person example from 168 valid draws to 96. It changes nothing for three people, where every valid draw is a loop of all three.

For a remote team, an online secret santa generator saves passing a hat around a video call. The organizer runs the draw and sends each giver their own row, by direct message or email, and nothing else. The table has a ready-made message for each giver with the budget in it. Copy the table before changing anything, because every edit makes a new draw. For gifts that travel, set a shipping deadline as well as the budget.

Heavy exclusions change the method. If 1,000 shuffles in a row all break a rule, the generator switches to a search. It proves whether any valid draw exists, finds one if it does, then mixes it with random swaps. That fallback draw is valid, but it is not exactly uniform: some valid draws can come up more often than others. The result says which method made the draw. A group with a few couples kept apart is settled by shuffling.

Secret Santa Generator FAQ

How does a Secret Santa generator work?

It shuffles the list of names and gives each person the name in their position in the shuffle. If anyone gets their own name or someone they're excluded from, it throws the shuffle away and tries again. Every valid draw ends up exactly equally likely.

Can I stop couples drawing each other?

Yes. An excluded pair, such as Ava and Ben, works both ways, so neither draws the other. A one-way exclusion stops only the first name drawing the second.

Why does it say my draw is impossible?

Some people have too few names left to draw. The message names them: for example, with three people and one couple kept apart, both of the couple can only draw the third person. Dropping one of the exclusions it names makes the draw possible again.

What are the odds of drawing your own name from a hat?

Each person has a 1 in n chance, but the chance that someone in the group does is high. With six people it is 63.19%, because only 265 of the 720 orders give nobody their own name. For bigger groups it settles at 1 - 1/e, or 63.21%.

Can the organizer take part without knowing who has them?

Not with one shared list: whoever runs the draw sees all of it. Ask someone outside the exchange to run it and send each giver their own message, or accept that the organizer knows one thing everyone else doesn't.

Are the names sent anywhere?

No. The draw runs in your browser. The list is kept in the address bar so a reload keeps it, so a link you copy carries the names, but never the draw.

Related calculators

Embed this calculator
<div id="compoundpage-secret-santa-generator"></div>
<script src="https://compoundpage.com/embed/secret-santa-generator.js" async></script>

The same calculation as JSON