Secret Santa Generator

Type everyone's names, keep couples apart, and draw. Each person gets their own link to open on their phone and see who they are buying for — no emails, no sign-up, no app. Add a budget and a date and they travel in every link. Print QR cards to hand out instead, and if your rules make a fair draw impossible, the generator says so and names who is stuck.

Aisha Ben Carla Dev Elena Finn Grace Hugo

Example group — add your first name and it clears.

8 people, 3 rules. Ready to draw.

Names each

Tap two names on the ring to keep them apart. Leave this on if you are taking part too.

Who is taking part

8 of 40

Type a name and press Enter, or paste a whole list — one per line or separated by commas. Up to 40 people.

Keep apart

Couples, housemates, last year's pairs — anybody who should not draw somebody.

  • Aisha ⇄ Ben
  • Dev ⇄ Elena
  • Finn → Grace

The details

Optional. Whatever you fill in here appears on every reveal page and card.

Put this generator on your site

Paste these two lines into any page — an office intranet, a club website, a family blog. The draw works inside the frame, and the links it hands out open here.

Preview the embed

The draw takes a minute. The rest of December is lists, and Homsy keeps the gifts, the food and who is bringing what on everyone's phone.

Your names, exclusions, details and the draw are saved in this browser, so you can come back and resend a link. There is no account, and clearing your browser data clears the list.

How the draw works, and what is in a link

Every person may draw anybody except themselves and anybody you have kept apart from them. "Each other" removes both directions between two people; "one way" removes only one. Before anything is drawn, the generator checks that a draw keeping every rule exists at all. For one name each that is a matching problem — can every person be handed a different name they are allowed to draw — and it is answered exactly, not by trying and hoping. When the answer is no, the page names the people responsible: a set of givers who, between them, are allowed to draw fewer names than there are of them. Hall's marriage theorem says a draw exists exactly when no such set does, so naming the set is naming the reason.

For one name each, the draw is a shuffle. The whole list is shuffled with the browser's cryptographic random number generator, and the shuffle is kept only if every person landed on somebody they are allowed to draw; otherwise it is shuffled again, up to twenty thousand times. Keeping only the shuffles that pass gives every valid draw exactly the same chance. Only when the rules leave so few valid draws that twenty thousand shuffles all fail does the page fall back on a randomised search, which always finds one but does not promise every draw an equal chance.

For two names each, the existence check is a flow problem: everyone gives two, everyone receives two, nobody draws the same person twice. The draw itself is two rounds of the one-name shuffle, the second barred from repeating the first. That comes close to an equal chance for every valid two-name draw without being exactly equal, and we say so rather than round it up.

The figure in the text below the tool is plain arithmetic. When everyone in a group pulls one name from a hat, the share of draws in which nobody gets their own name is the number of derangements divided by the number of orderings: 9 of 24 for four people, 44 of 120 for five, 14,833 of 40,320 for eight. From four people upward it stays between 36% and 38%, and it settles at one divided by e, about 36.8%.

Each link carries one person's draw: the event name, their own name, the name or names they are buying for with any hints you added, the budget, the date, your note, a four-character draw code and the minute the draw was made. It is scrambled so a name cannot be read at a glance in a message preview. That is not encryption: anybody who opens a link sees what it holds, so send each person only their own. The printed cards carry the same link as a QR code, at error-correction level M, which the QR standard specifies as able to recover about 15% of a damaged symbol, or level L, about 7%, for a link too long to fit at M. The cap of forty people is our own choice — past it the ring of names and the page of cards stop being readable. The calendar file on the reveal page holds one all-day event on the exchange day with a reminder a week before, and names the day and the budget but never the person. The names, exclusions, details and draw are saved in this browser, so the organiser can resend a lost link; there is no account.

Where these numbers come from

  1. 1. On Representatives of Subsets (Hall's marriage theorem) — P. Hall, Journal of the London Mathematical Society, 1935
  2. 2. A000166: Subfactorial or rencontres numbers, or derangements — The On-Line Encyclopedia of Integer Sequences
  3. 3. ISO/IEC 18004:2015 — QR Code bar code symbology specification — International Organization for Standardization
  4. 4. Crypto: getRandomValues() method — MDN Web Docs, Mozilla

Every figure above was read out of the code that runs on this page. Where a number is our own judgement rather than a published one, the note says so and cites nothing. Method last checked 28 September 2026.

Why a Secret Santa hat draw goes wrong

Names in a hat still work for four people round a kitchen table. They stop working as the group grows, and the arithmetic says why. For any group of four or more, the chance that nobody pulls their own name sits between 36% and 38% — so most hat draws need a redo, and the last person to pull cannot redo at all, because theirs is the only slip left. A generator does the redo for you, invisibly, as many times as it takes.

Exclusions are the second way a hat fails. It cannot know that two of the names are a couple who were going to buy for each other anyway, or that the same two people drew each other last year. Every rule you add makes a hat draw more likely to go wrong, and past a point there is no draw at all that keeps every rule — which a hat will never tell you. This generator checks first, and when the rules cannot all hold it names the people who are squeezed and the names they are squeezed into, so you know which exclusion to drop.

The third problem is the organiser. Somebody has to run the draw, and in most groups that person wants a surprise too. Here the pairs stay hidden unless you ask to see them, and each person sees their own name on their own phone, so the organiser can take part like everyone else.

Agree the budget and the date before the draw, not after: a figure written on every card is what stops one person spending three times what everyone else did. For the rest of the list, planning Christmas gifts covers setting a figure per person, and the printable Christmas planner puts the gifts, the dinner and the countdown on three sheets. If the Secret Santa is part of a family Christmas, planning Christmas dinner covers who brings what, and the expense split calculator settles the shared costs afterwards.

The honest limit is the one every link has: it only reaches the person you send it to. If somebody loses theirs, open this page on the device you drew on — the draw is saved in that browser — and send it again.

Frequently Asked Questions

How does this Secret Santa generator work?

Type everyone's name, mark anyone who must not draw each other, add a budget and a date if you want them, and press Draw. Each person gets a link of their own. Send it by WhatsApp, text, Slack or anything else that carries a link; when they open it, a wrapped gift on their phone unwraps to show who they are buying for, with the budget, the date and any hint you added.

Do I need everyone's email address?

No. There are no emails, no accounts and nothing to sign up for. The generator gives you one link per person and you send it however your group already talks. If some of the group are in the same room, print the QR cards instead and hand them out.

How do I stop couples drawing each other?

Keep them apart. Pick two names and choose "each other" for a couple or housemates, or "one way" when only one of them must not draw the other — last year's pairs, for example. You can also tap two names on the ring. Every draw keeps every rule you set, and the ring shows each one as a knot between the two names.

What if there is no valid draw?

The generator says so before it draws and tells you who is stuck — for example, "Aisha, Ben and Carla can only draw from Dev and Elena between them: three people, two names." That happens when the exclusions leave a group with fewer names to draw from than there are people in it. Remove one of their exclusions and draw again.

Can the organiser see who got whom?

Only if they choose to. The draw is made on the organiser's phone or computer, and the pairs stay hidden unless the organiser switches them on, so an organiser who is also taking part can run the draw and still be surprised. Every link is on the organiser's screen, though, and anyone who opens a link sees what it holds — so send each person only their own, and do not open them yourself.

Can everyone buy for two people?

Yes. Switch "Names each" to two and everybody draws two names and is drawn twice, with nobody drawing the same person twice. Exclusions still hold. It needs at least three people, and a group with a lot of exclusions is more likely to have no valid two-name draw — the generator tells you when that is the case.

Does it work with an odd number of people?

Yes. Secret Santa is a chain, not a set of pairs, so any number from three to forty works. With two people there is nothing secret about it, so the generator asks for a third.

What happens if I draw again?

Everybody gets a new link. Links from the earlier draw still open and still show the earlier draw, because each link carries its own result. Every reveal page and card shows a four-character draw code and the time of the draw, so tell the group which code counts and send the new links.

Can I print the Secret Santa draw?

Yes, two ways. The cards print eight to a page, one per person, with their name on the front and a QR code that opens their reveal; cut them out and hand them round. The list prints every name beside its link, with a box to tick as you send each one. Choose Save as PDF in the print window if you would rather keep a file.

Is the draw really random?

Yes. For one name each, the generator shuffles the whole list with the browser's cryptographic random number generator and keeps the shuffle only if everyone landed on somebody they are allowed to draw, so every valid draw has the same chance. For two names each it runs two rounds of that, the second not allowed to repeat the first, which comes close to an equal chance without being exactly equal.

Does the generator save my list?

Yes, in this browser. The names, exclusions, details and the draw are kept in this browser's local storage, so you can come back later and resend a link to somebody who lost theirs. There is no account, and clearing your browser data clears the list.

Related Tools

Keep the rest of December on one list with Homsy

The draw takes a minute. The rest of December is lists — the gifts, the food, who is bringing what. Homsy keeps them on everyone's phone, shared with the people doing the jobs.