ToolNimba Browse

🎅 Secret Santa Generator

By ToolNimba Editorial Team · Updated 2026-06-19

Assignments
Add at least two names, then press Draw names.

This Secret Santa generator draws the names for your gift exchange in one click. Paste in everyone who is taking part, one name per line, and press Draw names. Each person is randomly assigned someone else to buy a gift for, and nobody is ever matched with themselves. The full giver to receiver list appears on screen so an organizer can hand out the assignments, and you can copy the whole list with one tap.

What is the Secret Santa Generator?

Secret Santa (also called Kris Kringle or a gift exchange) is a tradition where a group of people each anonymously buy a present for one other person in the group, rather than everyone buying for everyone. It is a popular way for families, friend groups, offices and clubs to share the joy of giving while keeping the cost and effort sensible. The only thing you have to organize is who buys for whom, and that is exactly what this tool does.

The maths behind a fair draw is a little stricter than a plain shuffle. A valid Secret Santa assignment is what mathematicians call a derangement: a rearrangement of the list where no item stays in its original place, so no person draws their own name. This generator builds the assignment by shuffling the participants with a Fisher-Yates shuffle driven by your browser crypto random number source, then checks the result. If anyone was matched to themselves it reshuffles and tries again until the draw is valid. With two or more people a valid derangement always exists, and a random shuffle is one most of the time, so a clean draw is found almost instantly.

Because everything runs inside your browser, no names are uploaded, stored or emailed anywhere. That makes the tool fast and private, but it also means this version reveals every pairing on screen, so it is meant for an organizer who will pass on each assignment privately rather than for a fully secret self-service draw. If you want true secrecy, have one person who is not playing run the draw, or split the screen so each participant only sees their own line.

When to use it

  • Running an office or workplace Secret Santa where one coordinator hands out the assignments.
  • Organizing a family or extended-family gift exchange so each person buys for just one relative.
  • Setting up a friend group or club draw quickly without a sign-up, app download or email.
  • Redrawing fairly when someone joins or drops out and you need a fresh set of pairings.

How to use the Secret Santa Generator

  1. Type or paste every participant, one name per line, in the box.
  2. Leave "Ignore blank lines and duplicate names" ticked to clean the list automatically.
  3. Press Draw names to assign each person someone else to give a gift to.
  4. Read the giver to receiver list, then press Copy pairs to save or share it.

Formula & method

A valid draw is a derangement of the n participants: a permutation where assignment(i) is never i, so no one gives to themselves. The number of valid draws for n people is the subfactorial !n, and the chance a random shuffle is valid approaches 1 ÷ e (about 36.8%) as n grows.

Worked examples

A small family draw with four names: Alex, Jordan, Sam and Riley.

  1. Enter the four names, one per line.
  2. The tool shuffles the list, for example to Sam, Riley, Alex, Jordan.
  3. It checks that nobody lines up with their own position (no self-match).
  4. It pairs each original name with the shuffled one: Alex gives to Sam, Jordan gives to Riley, Sam gives to Alex, Riley gives to Jordan.

Result: Four valid pairings where every person gives and receives exactly one gift, and nobody draws themselves.

A draw where the first shuffle is invalid because one person got themselves.

  1. Three names are entered: Mia, Noah, Liv.
  2. A shuffle produces Mia, Liv, Noah, but Mia is back in position one (a self-match).
  3. The tool rejects this draw and reshuffles automatically.
  4. The next shuffle gives Noah, Liv, Mia, which has no self-matches, so it is accepted.

Result: Mia gives to Noah, Noah gives to Liv, Liv gives to Mia: a valid three-person derangement.

How many valid Secret Santa draws (derangements) exist by group size

Participants (n)Valid draws (!n)Chance a random shuffle is valid
2150.0%
3233.3%
4937.5%
54436.7%
626536.8%
101,334,96136.8%

Common mistakes to avoid

  • Trying to run it with only one name. A gift exchange needs at least two people, because a single participant has no one else to give to. Add a second name before drawing.
  • Expecting the draw to stay secret on this screen. This version shows every pairing for an organizer. If you want it truly secret, have a non-participant run the draw, or reveal only one line to each person.
  • Leaving in duplicate or misspelt names. Two slightly different spellings of the same person (Sam and sam) can be treated as two people. Keep the duplicate filter on, or tidy the list so each participant appears once.
  • Forgetting to set exclusions yourself. This tool only prevents self-matches. If couples or close family should not draw each other, draw again until the pairings suit, or split those people across separate exchanges.

Glossary

Secret Santa
A gift exchange where each person anonymously buys one present for one other person in the group.
Derangement
A rearrangement of a list in which no item keeps its original position, which is exactly what stops anyone drawing their own name.
Giver
The person who buys and gives the gift in a pairing.
Receiver
The person who is assigned to receive a gift from their giver.
Fisher-Yates shuffle
A standard algorithm that puts a list into a uniformly random order, used here to mix the participants before checking the draw.

Frequently asked questions

How does the Secret Santa generator work?

You paste a list of participant names, and the tool randomly assigns each person someone else to give a gift to. It shuffles the list using your browser secure random source, then checks that nobody was matched with themselves, reshuffling until the draw is valid.

Can someone be assigned to themselves?

No. The generator produces a derangement, meaning it keeps reshuffling until no one draws their own name. Every person gives to, and receives from, a different participant.

How many people do I need for a draw?

At least two. With two people they simply give to each other. There is no upper limit, and the tool handles large lists just as quickly as small ones.

Is the result really random and fair?

Yes. The shuffle uses crypto.getRandomValues with rejection sampling, so there is no bias toward any order, and every valid set of pairings is possible. Each draw is independent, so you can redraw freely.

Is this Secret Santa draw private?

Everything runs in your browser, so no names are sent or stored anywhere. However, this version displays all pairings on screen for an organizer, so it is not secret by itself. For true secrecy, have a non-participant run it or reveal one line per person.

Can I stop certain people from drawing each other?

The tool only guarantees that nobody draws themselves. To keep, say, a couple apart, redraw until the pairings suit, or run two smaller exchanges. Manual exclusion rules are not built in.