Free online tool

Secret Santa Generator

Draw names with spouse exclusions, swap protection, and private reveal links—all in your browser with no sign-up.

Quick examples:

Participants 6 people

1
2
3
4
5
6

Matching rules & exclusions

Maya ↔ Liam

6 participants, 1 exclusion rule, 96 valid draws.

Participants 6
Exclusions 1 (2 blocked pairs)
Valid draws 96
Hat self-draw risk 63.19%

Pairings stay hidden below so the organizer can join too. Send each person their private link or pass the screen in person.

Maya Ready to share
Liam Ready to share
Priya Ready to share
Noah Ready to share
Chloe Ready to share
Sam Ready to share

Who it’s for: Organizers of family, office, classroom, or friend gift exchanges who want fair pairings, exclusion rules, and private reveal links without forcing everyone to create an account.

How it works

  1. Pick a quick example or type each participant's name and optional gift hint.
  2. Set exclusions for spouses, partners, or last year's pairings, and pick a matching rule.
  3. Click Generate new draw to match everyone in your browser without spoilers.
  4. Copy each person's private reveal link, paste the invite message, or pass the phone around in person.

How the matching algorithm avoids self-draws and direct swaps

Pulling folded paper from a hat fails surprisingly often because anyone can pick their own slip. Take a 6-person group with no exclusions in standard mode: there are 265 valid derangements, and drawing names from a hat carries a 63.19% risk of someone picking themselves.

This tool avoids self-draws from the start and lets you control cycle structure. Switching that same 6-person group to avoid direct two-person swaps narrows the pool to 160 valid draws with zero A-to-B-to-A pairs, while choosing single continuous loop leaves 120 one-ring cycles.

Avoiding two-person swaps is the default for small and mid-sized groups because trading directly with the person who drew you often spoils the surprise. Single-loop mode works well when everyone sits in one room and unwraps gifts sequentially around the circle.

How exclusions shrink the draw and detect impossible rules

Exclusions restrict who each giver may buy for, either one-way (for last year's match) or both ways (for partners and households). Adding one mutual couple exclusion such as Maya and Liam in the default 6-person group drops the count from 265 to 168 standard pairings, or 96 draws when avoiding direct swaps.

Heavy pairing constraints narrow the options even further. Adding three mutual couple exclusions among 6 people (Elena and Marcus, Hannah and Ben, Nadia and Owen) leaves 80 standard draws, 48 swap-free draws, and 32 single-loop draws.

Before drawing, the generator checks a bipartite matching graph to catch dead ends early. For example, if you take 3 people and set one mutual exclusion between two of them, the tool returns 0 valid draws because both excluded partners can only buy for the third person. Likewise, if you select the no-swaps mode with only 2 participants, the generator stops and asks for at least 3 people because two people can only swap with each other.

Private reveal links, randomness, and known limits

Nothing leaves your device during a draw. Each participant gets a link ending in a #reveal= fragment that carries the giver, recipient, gift hint, event title, budget, and exchange date encoded with a two-byte salt. Because URL fragments after # stay inside the browser, web servers do not receive the pairing in standard requests.

For groups up to 12 people in standard mode (or up to 10 in single-loop mode), dynamic programming counts every valid assignment and samples one uniformly using a 32-bit seed from window.crypto.getRandomValues. Larger lists use randomized Minimum Remaining Values backtracking so groups of 25 or 50 people still finish in milliseconds.

Three practical limits apply. First, the organizer can always reveal the full table if needed, so use private links or pass-the-phone mode when you want to stay surprised yourself. Second, the #reveal= token prevents casual peeking rather than acting as cryptographic encryption, so treat links as spoiler shields rather than secrets against someone running a decoder. Third, when a group with custom exclusions exceeds the exact-counting limit (12 in standard mode, 10 in single-loop, or 8 in no-swaps), the generator omits the exact permutation count instead of guessing.

FAQ

Can the organizer participate without seeing everyone else's match?

Yes. By default, the results panel only shows each participant's name alongside Copy link, Copy message, and Peek in person buttons. As long as you do not click Reveal all pairings, your own match stays private until you open your personal link.

Do participants need an account, app, or email address?

No. The generator runs locally in your browser. You copy each private reveal link or pre-written invite message into WhatsApp, Slack, SMS, iMessage, or email.

How do I stop spouses or last year's matches from pairing up?

Use the exclusion builder under Matching rules. Pick two people, leave Apply both ways checked for couples, or uncheck it to block only one direction such as preventing someone from drawing the same recipient two years in a row. You can also click Copy next-year exclusions after a draw to save this year's list.

Why did the tool say my exclusions are impossible?

Certain combinations leave fewer available recipients than givers in a subgroup—such as 3 people where two cannot draw each other, or one person excluded from every remaining guest. The error notice names the blocked group so you can remove one rule or switch from single-loop to standard mode.

How is randomness handled?

Every draw pulls a fresh 32-bit seed from the browser's Web Crypto API (crypto.getRandomValues) and weights small groups by exact combinatorial counts so every allowed arrangement has the same probability of being chosen.

Sources

Last checked: 2026-11-23