Rules that are never broken
Add a rule for every pair that should not end up together. Never paired with works both ways and suits couples, siblings or people who live together. Does not draw works in one direction only, which is handy for avoiding last year's match: if Anna gave to Ben last year, add Anna does not draw Ben. The option Two people never draw each other prevents swaps, where Anna gives to Ben and Ben gives to Anna.
Before drawing, the generator checks whether your rules leave a possible result at all. If they do not, for example because one person is excluded from everyone, it tells you which name causes the problem instead of trying forever or quietly ignoring a rule.
A fair draw
The draw uses your browser's secure random number generator and picks one result from all the valid ones with equal chance. It shuffles the whole list and keeps the result only if every rule is met, the same as drawing slips from a hat and starting again when someone pulls their own name. With very strict rules, where that would take too long, it switches to a careful step by step search that still never breaks a rule.
Two ways to reveal
Pass the phone works best at a party or in the office: everyone taps their own name, checks that nobody is looking, presses Show, and hides the result before handing the phone on. Names already seen are marked, so you know who is missing.
Private links suit groups that are not in one place. Each link opens a page with a greeting for that person and their result behind a Show button. The name is encrypted inside the link, so it cannot be read from the link text, and it never reaches a server. Be aware that anyone who opens a link can see what is in it, including you as the organiser. If you want to stay surprised, send the links without opening them, or let one person who is not taking part send them.