How the randomness works
The generator shuffles the names with the Fisher-Yates method: working from the back to the front, each name swaps places with a randomly chosen name before it. Every possible order is equally likely – no position and no name is favoured.
The random numbers come from your browser’s cryptography interface (crypto.getRandomValues), not from the simpler Math.random. The shuffled names are then dealt out to the teams in turn, like cards. That way, team sizes never differ by more than one person.
Equal teams, even when the numbers don’t divide
A group rarely splits evenly. With 14 people and four teams you get two teams of four and two of three – not three teams of four and one of two. The smaller teams are never badly short-handed.
If you choose “people per team”, the number is an upper limit. Ten people with at most four per team gives three teams of 4, 3 and 3. Nobody ends up alone in a leftover team, and no team is bigger than you asked for.
Why drawing lots is fairer than picking
Anyone who has let captains pick their teams knows the scene: the last few wait on the sidelines, and groups of friends stick together. A random draw takes that decision away from everyone. Nobody has to justify anything, and new combinations happen by themselves – at team days, workshops or games with mixed groups, that is often the real benefit.
If certain people should play apart – two managers, say, or siblings – draw first and then swap individual names on purpose. Tell the group openly and the process stays transparent.
Code names instead of Team 1 and Team 2
A name gives a team an identity faster than a number. Tick “Name the teams automatically” and every team gets a neutral agent code name such as Team Falcon or Team Lynx, drawn at random from a fixed list. The names are deliberately neutral: no “winners”, no “leftovers”.
If you need more teams than the list has names, the generator simply numbers the rest.