Typical uses
- Mixing up class groups or workshop tables so they differ each session
- Splitting a five-a-side or pickup basketball crowd into two sides
- Pairing study partners while keeping certain people apart
- Dividing event volunteers into crews, each with one lead
With no rules: shuffle, then deal
The list is shuffled with the Fisher–Yates method, using numbers from the browser’s crypto.getRandomValues. The shuffled names are then dealt like cards: first to team 1, second to team 2, third to team 3, fourth back to team 1, and so on. Team sizes therefore differ by one at most, and any extra people go to the lowest-numbered teams first.
Seven names, Ava, Ben, Cleo, Dan, Eli, Fay and Gus, split into three teams in one run as 3, 2 and 2 people. Because every order is equally likely at the shuffle step, the chance of any two people ending up together is exactly what the arithmetic says. Split 12 people into three teams of four and a given pair shares a team with probability 3/11, about 27.3%; 100,000 simulated splits gave 27.2%.
Choosing a team size instead of a number of teams
- 1With Team size, the number of teams is the head count divided by the size, rounded up. People are then spread as evenly as above, so the size you enter works as the largest a team can be.
- 2Nine people, teams of 4: rounding up gives three teams, which come out 3, 3 and 3, not 4, 4 and 1.
- 3Thirteen people, teams of 4: four teams of 4, 3, 3 and 3. Eleven people, teams of 5: three teams of 4, 4 and 3.
- 4Seven people, teams of 2: four teams of 2, 2, 2 and 1, leaving someone on their own. For pair work, ask for three teams instead and get 3, 2 and 2.
With rules: placing groups, not people
People who must stay together are first fused into a single unit. Units containing a captain go one to each of the first teams; the rest are placed largest first, with equal sizes in shuffled order. Each unit tries the teams in a random order and takes the first that keeps within the size limit and the keep-apart rules. If a unit has nowhere to go, the search steps back and tries another arrangement, for up to 200,000 steps before it asks you to drop a rule.
The outcome is random, but this search does not promise that every split satisfying your rules is exactly as likely as every other. In everyday use you will not notice, though it is worth knowing if strict fairness matters. Names in the rules must also match the list exactly: if the list says Cleo and a rule says Cloe, you are told that a rule names someone not on the list.
Balancing skill or other traits
There is no field for skill ratings, but the keep-apart rule does the job of seeding in a tournament. Take as many of the strongest players as there are teams and keep them apart: each team gets exactly one. You can use several groups at once. Nine people, A to I, split into three teams with A+B+C and D+E+F kept apart, came out as F, A, I / G, E, B / H, C, D, so every team received one person from each group.
The same approach spreads out gender, year group or anything else. To put six people evenly across three teams, make two groups of three and keep each group apart. A group larger than the number of teams cannot be spread one per team, so keep each group no bigger than the team count.