Step 1: Add Participants Setup
Minimum 3 participants required 0 participants
Exclusion Pairs: these two people will not draw each other

No exclusion pairs added yet.

Step 2: The Secret Vault Private
Pass the device around, one person at a time. Each participant clicks only their own name to see who they are giving to. The match is visible for 10 seconds only, then the box automatically relocks. Nobody else can see a result unless they tap their own name.
Key Terms Explained
Derangement
A permutation where no element appears in its original position. In a gift exchange, this guarantees no participant is ever matched with themselves.
Fisher-Yates Shuffle
An unbiased algorithm that randomizes an array so every permutation is exactly equally probable. The gold standard for fair random draws.
Algorithmic Fairness
The property that every eligible assignment has an equal probability of selection. No participant is systematically favored or penalized by the engine.
Random Permutation
A rearrangement of a set in random order. A Secret Santa draw is a constrained random permutation, specifically a derangement.
Subfactorial (!n)
The count of valid derangements for a set of n items. For 4 people, !4 equals 9 possible valid Secret Santa assignment maps.
Exclusion Constraint
A rule that prevents two specific participants from being matched. Commonly used for couples or close family who already exchange gifts.
Click-to-Reveal
A privacy interface where each assignment is hidden until the correct participant taps their own name. Prevents accidental exposure to onlookers.
Client-Side Processing
All computation runs in your browser's JavaScript runtime. No server receives participant names or match data at any point in the process.

The Complete Guide to Secure Secret Santa Name Assignment

Organizing a Secret Santa exchange sounds simple, but doing it fairly and privately is harder than it looks. Paper slips can be peeked at, email-based services store participant lists on remote servers, and a casual phone-shuffle often lands someone with their own name. This engine solves all three problems using proven mathematical algorithms and a fully browser-based privacy architecture.

How to Use This Tool

Type each participant's name on a separate line in the input box at the top. The engine updates the participant count in real time as you type. If you have couples or family members who already buy gifts for each other independently, click "Add Exclusion Pairs" and select the names that should never be matched together. When the group is ready, click "Draw Secret Names." The Secret Vault appears below with a locked gift box for every participant.

Pass the device around the room to each person one at a time. Each person finds their own name on the grid and taps it. Their match appears for exactly 10 seconds, then the box automatically relocks. Once the device is passed to the next person, the previous result is completely hidden from view.

Why the Derangement Algorithm Matters

A naive shuffle might assign Alice to Alice or Bob to Bob. The technical term for a permutation where no element lands in its original position is a "derangement." The probability that any given random shuffle produces a valid derangement approaches 1/e (approximately 36.8%) as group size grows. Rather than leaving this to chance, this engine detects any self-match and discards the entire shuffle, then immediately regenerates. This continues automatically until zero self-assignments remain, no matter how many attempts are needed.

Fisher-Yates Shuffle: Why It Beats the Alternatives

Sorting by random values (such as attaching Math.random() to each name) produces non-uniform distributions where some permutations appear more frequently than others. This introduces hidden bias into the draw. The Fisher-Yates algorithm avoids this entirely by walking backward through the participant list and swapping each name with a randomly chosen earlier position. The mathematical result is that every permutation of the list is exactly equally probable, making it the correct algorithm for a genuinely fair gift exchange.

Privacy by Architecture

Many popular Secret Santa web services process participant names on their own servers. This means a database entry exists containing every assignment, and an administrator could theoretically access the full results. This engine processes everything inside your browser's JavaScript runtime only. No name, no assignment, and no event metadata ever leaves your device. Closing the tab or clearing the page destroys all match data permanently, with no recovery path.

How to Handle Exclusions Without Breaking the Draw

Adding too many exclusion pairs in a small group can make it mathematically impossible to find a valid derangement. If no valid assignment exists after an extended search, the engine reports a failure rather than silently returning a broken result. As a practical guideline, avoid excluding more than one-third of all possible pairs in groups smaller than 6 people. Adding one or two more participants is almost always the simplest fix when the engine cannot find a valid draw.

Frequently Asked Questions

The engine uses a mathematical derangement algorithm built on top of a Fisher-Yates shuffle. After every shuffle, it checks whether any participant was assigned to themselves. If even one self-match is found, the entire shuffle is discarded and a new one is generated. This repeats automatically until a valid derangement is found, guaranteeing zero self-assignments every time.
A derangement is a permutation of a set in which no element appears in its original position. For a gift exchange, this means every participant is guaranteed to give a gift to someone other than themselves. The mathematical subfactorial notation !n counts the number of valid derangements for a group of n people.
The Fisher-Yates shuffle algorithm produces a statistically uniform random permutation, meaning every valid assignment is equally likely. This is the gold standard for algorithmic fairness in random draws. Each participant has an equal probability of being matched with any eligible recipient, subject only to the derangement and exclusion constraints you define.
When a server handles Secret Santa assignments, the matches exist on that server and could theoretically be accessed by the server owner, a data breach, or a technical error. This engine runs entirely in your browser. Names are never sent to any server, never stored in a database, and vanish the moment you close the tab. The only people who can see the matches are the participants themselves, one at a time, via the click-to-reveal interface.
Use the Add Exclusion Pairs section to enter pairs of names who should not be matched with each other. The engine treats each exclusion as a two-way block: if you exclude Alice and Bob, Alice will not draw Bob and Bob will not draw Alice. The derangement algorithm retries the shuffle until all exclusion constraints are satisfied alongside the no-self-match guarantee.