Secret Santa Generator

Add the names, draw, and pass the device around so everyone finds out their match privately.

One group per line, separated by commas, for example Ann, Bob for a couple. Everyone on a line is kept apart.

How the draw is made

The generator first checks your list: at least 3 names, at most 60, and no two names the same (the comparison ignores upper and lower case, so "ann" and "Ann" count as duplicates). It then builds the rule set. Nobody may draw themselves, and every pair you put together on one line of the exclusions box is blocked in both directions.

To pick the matches, it shuffles the names with an unbiased Fisher-Yates shuffle driven by crypto.getRandomValues, and lines the shuffled list up against the givers. If every pairing is allowed, that is the draw. If not, it reshuffles, up to 400 times. When the rules are tight enough that random tries keep failing, it switches to a systematic search that tries receivers for each giver in turn and backs up when it gets stuck. That search finds a valid draw whenever one exists, so the message "no valid draw exists" is reliable, not just bad luck.

Writing exclusions

Worked examples

Six coworkers, with two who share a desk: enter the six names, add the desk pair as one exclusion line, and press Draw names. Each person gets exactly one match and is matched by exactly one person. With four people, a couple and nothing else, a valid draw exists but it is limited, because each of the couple has only two possible choices. If you exclude too much, for example one person from everybody else, the tool tells you no valid draw is possible.

One thing to know: two people can end up drawing each other (Ann gives to Bob and Bob gives to Ann) unless you exclude that pair. If you do not want mutual swaps, add the pair to the exclusions box.

Keeping it secret

Questions

Can I run the draw again?

Yes. Press Draw names again for a completely new draw. Do this before anyone has looked at their match, because the previous matches are replaced.

Is the list saved?

Your names and exclusions are stored in your browser's local storage on this device so you can return to them. They are not sent anywhere. The results of a draw are kept only on the page.

How many people can take part?

From 3 to 60 names.

Can it handle a family or office with many rules?

Yes. Add as many exclusion lines as you need, as long as a valid draw is still possible.

Related tools

How the Secret Santa draw works

Everyone in the group is matched with one other person to buy a gift for, and nobody knows who has drawn them. This generator makes the draw in your browser: nobody draws themselves, everyone gives one gift and receives one gift, and any people you list together (like a couple) are never matched to each other.

To keep the surprise, do not show the full list. Pass the device around: each person taps their own name, reads who they are buying for, and presses Hide and pass on before handing it to the next person. Your names are stored only in your own browser, and nothing is emailed or uploaded.

Tips for a great Secret Santa

Splitting a group into teams for a party game? Try the team generator.

Frequently asked questions

Can two people be kept from drawing each other?

Yes. Put them on the same line in the exclusions box, separated by a comma. You can list a whole family on one line to keep them all apart.

What if the draw is impossible?

If the exclusions leave no valid draw (for example, someone is excluded from everybody), the tool tells you. Remove some exclusions and try again.

Does everyone give and receive exactly one gift?

Yes. Each person is drawn exactly once and nobody draws their own name.

Are the names sent to a server or emailed?

No. Everything happens on your device. The list is remembered in your browser so you can come back to it, and you can clear it by emptying the boxes.