By Paul Clark · Published: 2026-05-12
How to run a fair Secret Santa (and survive the office holiday party)
Pulling names from a hat is a tradition. It is also, mathematically speaking, the worst way to run a gift exchange. Here is what goes wrong, what to do instead, and how to make sure nobody ends up buying a present for themselves.
The "draw your own name" problem
Every Secret Santa story starts the same way. Twelve people put their names in a bowl, twelve people draw a name out, and inevitably at least one person draws their own. They announce it, someone makes a joke about treating themselves, and then the whole bowl has to be reset and redrawn. By the third attempt, half the room has already seen at least one other person's pick. The "secret" part of Secret Santa is, at this point, on life support.
The reason this keeps happening is not bad luck — it is statistics. If you draw names at random from a hat, the probability that at least one person draws themselves converges to about 63% as the group grows. (This is the famous "derangement problem" from combinatorics, and the limit is one minus one over Euler's number.) Six office Secret Santas out of ten will hit a self-draw if you do it the traditional way. You are not unlucky; you are just running an unfair process.
What a "derangement" actually is
A derangement is a permutation where no element ends up in its original position. In
Secret Santa terms, that means a shuffle of the participant list where nobody is
matched to themselves. There are roughly n! / e derangements for a list
of n people, which is a lot — for a group of ten you have over 1.3
million valid arrangements. The trick is that you have to commit to picking only
from those, not from all possible draws.
Our Secret Santa Generator does this by generating a candidate permutation, checking it against a list of forbidden pairs (including the identity pair), and rejecting and retrying until it finds a valid one. For typical group sizes this is fast — the algorithm finds a valid derangement within a handful of tries even when you add extra exclusions. If 2,000 random tries all fail and the group has ten people or fewer, it searches every possible arrangement, so when it tells you no valid assignment exists, none does. Larger groups rely on the random tries alone, so there it says it couldn't find one. Either way it asks you to remove a forbidden pair rather than silently producing a broken draw.
Couples, roommates, and the "but they share a wallet" problem
The single most-requested feature for any Secret Santa tool is "make sure my husband doesn't draw me." This is reasonable: couples already buy each other gifts, so drawing one's own partner defeats the whole point. The same logic applies to roommates with combined finances, parents and children in family draws, and any pair of people who would otherwise just hand a wrapped item across the dinner table.
The way to handle this is with forbidden pairs — extra constraints that the generator layers on top of the no-self-draw rule. Each pair you add excludes both directions: if you say "Alex and Sam cannot draw each other," the generator treats Alex → Sam and Sam → Alex as invalid, and capital letters and extra spaces in the pair don't matter. You can stack as many of these as you want, with one important caveat: the more constraints you add to a small group, the more likely it is that no valid derangement exists at all. With ten people and three couples, you are fine. With four people and two couples, only four of the 24 possible draws survive — everyone has to buy for someone in the other couple. With three people where two are a couple, there is no valid draw at all: both partners can only give to the third person.
Remote teams: revealing assignments privately
The original Secret Santa relied on physical envelopes. For distributed teams that no longer works — you cannot put a piece of paper into a Slack channel and assume nobody else will read it. The naive workaround is to email each person individually, but that requires the organiser to see all the assignments, which silently destroys the secret.
Our generator uses the "reveal one card at a time" model: it outputs a deck of cards on screen, each card hides a single recipient behind its own Reveal button, and participants take turns opening only their own card. This works well for in-person events where everyone is together and can take the laptop somewhere private for their turn. It has no per-person links, so for a fully remote team you would need some other private channel to get each person their assignment — and whoever handles that step will see the draw. Either way, nobody should read any of the cards aloud.
Setting a budget, theme, and timeline
The randomiser does not solve the social part of Secret Santa, which is by far the harder part. A few patterns we have seen work well: agree on a budget before anybody draws (anywhere from $10 to $50 is normal; office gift cultures vary wildly), set a theme to give givers a starting point ("food and drink", "books", "something handmade"), and set a hard deadline that is at least a week before the actual exchange. The deadline matters because somebody will inevitably forget and you want enough lead time to either nudge them or quietly cover for them.
On the theme question — themes are good when the group does not know each other well. They are constraining when the group does. A team that has worked together for five years can do an open-ended exchange because they already know each other's tastes. A class reunion or a new team three weeks into a project benefits from narrower prompts because nobody knows where to start.
What to do when the draw goes wrong anyway
Occasionally something will still go wrong. The most common failure mode is that somebody drops out after the draw — they get sick, they leave the team, they simply forget. The right move when this happens is not to redo the whole draw, which would expose everyone else's assignment. Instead, only two people are affected: the person who was buying for the dropout, and the person the dropout was buying for. The simplest fix is for the first person to take over the dropout's recipient — unless that would be themselves (the two had drawn each other) or a forbidden pair, in which case swap with a willing volunteer. Leave the rest of the draw untouched, and most of the team never knows anything changed.
Another common failure is the constraint conflict — somebody mentions a forbidden pair after the draw is already done. If the resulting assignment violates the constraint, you have to redo it — and a redraw with the generator is a completely new shuffle, so nearly every assignment will change. That is why it pays to ask for forbidden pairs before you draw, not after.
Try the tool
The Secret Santa Generator runs entirely in your browser. Your participant list never touches our server, the derangement is computed locally, and each assignment sits behind its own Reveal button. The Recent results panel below the tool does list the full draw, though, so keep it closed and don't put the organiser's screen on a projector. If you need to pair people with prizes or tasks instead of names, the Random Prize Assigner is the same idea without the derangement constraint.