Quick answer: the names are shuffled fairly and dealt into teams whose sizes differ by at most one. For example, 25 people in 4 teams gives 7, 6, 6 and 6. Add keep together or keep apart rules and the generator finds a random arrangement that meets all of them, or tells you clearly why none exists.
Examples
| You want to… | Setting |
|---|---|
| 30 pupils into 6 groups | Number of teams: 6 → six groups of 5 |
| Pairs for a partner activity, with no one left alone | Number of teams: half the class, rounded down (13 people → 6 teams: five pairs and one trio) |
| Two friends who distract each other | Keep apart: Ava, Ben |
| A pupil and their support buddy | Keep together: Kai, Lena |
| Even spread of confident readers | Add | reader labels and tick “Balance by label” |
How to use it
- Paste one name per line. Duplicate names are kept as separate people and flagged.
- Choose Number of teams, or People per team (the maximum size). For example, 25 people with at most 4 per team gives 7 teams: four of 4 and three of 3.
- Optionally open Rules and balancing. In Keep together, each line is a set of names that must share a team. In Keep apart, everyone on a line must go to a different team.
- Press Make teams. Rename teams by typing on their coloured headers.
- Lock anyone you want to stay put, then press Make teams again to reshuffle everyone else. Use Move… to change someone’s team by hand; you’ll be warned if sizes become uneven.
- Copy, CSV, Print or Present the result. Undo steps back through changes.
How the teams are made
Without rules, the list is shuffled with the Fisher–Yates method, using your browser’s cryptographic random generator. It is then dealt into teams of the right sizes, so every split is equally likely.
With rules, people who must stay together are merged into a single unit. Keep-apart pairs become conflicts, and locked people are fixed to their team. The generator then places units one at a time in a random order, backtracking whenever a rule or a size limit would be broken. That gives three possible outcomes:
- A valid arrangement. Every rule is kept, and sizes still differ by at most one.
- “Not possible.” The search proved that no arrangement exists, for example three people who must all be apart but only two teams. Contradictions, such as the same two people set to be kept together and apart, are caught before searching.
- “Couldn’t find an arrangement in time.” The rules are so tangled that the search hit its time limit. That isn’t proof that it’s impossible; remove a rule or change the number of teams.
Balancing is best-effort: each person goes to the eligible team with the fewest people sharing their label, with random tie-breaks. It never overrides a rule or a size limit. Labels are whatever you type; the tool never guesses anything about anyone.
Privacy
Names are processed in your browser and never uploaded. Rosters are saved only if you press Save, and only on this device. Present mode hides the names list and the lock and move controls.
Questions
Is this also a random group generator?
Yes. Teams and groups are the same split. Choose how many groups you want, or how many people should be in each.
What happens with an odd number of people?
Sizes differ by at most one. 13 people in 2 teams gives 7 and 6. For pairs, set the number of teams to half the group rounded down: 13 people in 6 teams gives five pairs and one trio. (“At most 2 per team” would leave one person on their own.)
Can I keep the same teams but swap one person?
Yes. Use Move… next to their name. Or lock everyone you want to keep and press Make teams to reshuffle the rest.
Why did it say my rules are impossible?
Usually there are too few teams for a keep-apart set (four people who must all be apart need at least four teams), a keep-together set is bigger than a team, or locks clash with a rule.
References
- W3C. Web Cryptography Level 2: Crypto.getRandomValues(). World Wide Web Consortium specification.
- Richard Durstenfeld. Algorithm 235: Random permutation. Communications of the ACM 7(7), 1964.
- Donald E. Knuth. The Art of Computer Programming, Volume 2: Seminumerical Algorithms (3rd ed.), §3.4.2. Addison-Wesley, 1997.
Page reviewed 30 November 2026.