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.
Example group — add your first name and it clears.
8 people, 3 rules. Ready to draw.
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 40Type 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.
Send each person their link
The links appear here after the draw — one for each person, to send by WhatsApp, text, Slack or anything else that carries a link.
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.
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. On Representatives of Subsets (Hall's marriage theorem) — P. Hall, Journal of the London Mathematical Society, 1935
- 2. A000166: Subfactorial or rencontres numbers, or derangements — The On-Line Encyclopedia of Integer Sequences
- 3. ISO/IEC 18004:2015 — QR Code bar code symbology specification — International Organization for Standardization
- 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?
Do I need everyone's email address?
How do I stop couples drawing each other?
What if there is no valid draw?
Can the organiser see who got whom?
Can everyone buy for two people?
Does it work with an odd number of people?
What happens if I draw again?
Can I print the Secret Santa draw?
Is the draw really random?
Does the generator save my list?
Related Tools
Printable Christmas Planner
Three free printable Christmas planner pages: a gift planner with bought and wrapped columns, a Christmas dinner planner, and a 25-job countdown. Editable, no signup.
Printable Christmas Grocery List
A free printable Christmas grocery list in three sheets: the early shop for everything that keeps, the fresh shop for the last few days, and the foil, batteries and bin bags nobody writes down. 68 editable items, no signup.
Family Expense Fairness Calculator
Calculate a fair bill split based on each person's income. Perfect for couples, blended families, and households with unequal earnings.
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.