How a fair Secret Santa generator avoids self-draws and loops
Pulling paper scraps out of a hat fails more often than people expect: someone draws their own name near the end of the hat, or two spouses draw each other and force a full restart. In combinatorics, a draw where nobody receives their own name is called a derangement, and adding household exclusions turns the draw into a constrained directed graph matching problem.
This free Secret Santa generator solves that graph directly in your browser using cryptographically unbiased Web Crypto randomness. When four or more people join, you can also block direct two-person swaps so Person A and Person B do not simply trade gifts with each other while everyone else forms a separate loop.