Team Randomizer - Split Names into Balanced Random Teams
Paste a list of names and split it into random teams whose sizes differ by at most one person. Choose the number of teams, or the largest team size, and give the teams names from a theme.
Maintained by Hirantha Sandaruwan Lakshan. Updated 15 October 2026.
About this tool
You can also make the first names captains on different teams, keep friends together with A + B and keep others apart with A | B. Press Shuffle again as often as you like. Your names stay in your browser.
How it works
Balanced sizes: with n names in t teams, every team gets either n / t rounded down or n / t rounded up people, so sizes differ by at most one. Ten names in 3 teams make teams of 4, 3 and 3. If you choose people per team instead, the tool makes just enough teams that none is bigger than your size, which is n / size rounded up. Ten names with a size of 4 give 3 teams again, 4, 3 and 3, rather than 4, 4 and 2. Which teams get the extra person is chosen at random too.
With no rules and no captains, the list is shuffled with the Fisher-Yates algorithm, using your browser's secure random generator with rejection sampling, and then dealt out. Every possible split into those team sizes is equally likely. A common shortcut, swapping each place with a random place chosen from the whole list, is biased, and Wikipedia explains why. Members are listed alphabetically inside each team with captains first, so the order inside a team means nothing.
Captains are the first names in your list, one per team at most, and they are always on different teams. A rule written A + B keeps people on the same team, and A + B + C keeps three together. A rule written A | B puts people on different teams, and A | B | C keeps all three apart. Names must match the list, ignoring capital letters. With rules, the tool treats locked people as one block, puts blocks on teams one at a time in random order and undoes a move that breaks a rule or does not fit. The result always obeys every rule and is random, but it is not guaranteed to be equally likely among all the splits that obey the rules.
When rules cannot be met, the tool says why instead of guessing: a locked group bigger than the biggest team, two people who are both locked together and kept apart, more people to keep apart than there are teams, or rules that cannot all hold at once. The list is limited to 200 names, and the search stops after 200,000 placements. If it ever stops early it says it gave up, and does not claim the rules are impossible.
Worked examples
12 people into 3 teams
Use the example list of 12 names and 3 teams. 12 divided by 3 is 4, so you get three teams of four, with names such as Leopards, Elephants and Peacocks. Press Shuffle again for a different split.
10 people, teams of at most 4
Choose People per team and enter 4. Ten names need 3 teams, which is 10 / 4 rounded up, so the sizes are 4, 3 and 3 and no team has more than 4 people.
Captains who are not on the same team
Put the three captains at the top of the list and set Captains to 3 with 4 teams. Each captain lands on a different team and is marked and listed first. Asking for 5 captains with 4 teams gives a clear message, because captains go on different teams.
Keeping two people together and two apart
Write Kasun Perera + Nimali Fernando on one rule line and Ruwan Bandara | Dilini Wickramasinghe on another. Every split keeps the first two on one team and the second two on different teams. If you also write Kasun Perera | Nimali Fernando, you get a message that the two rules contradict each other.
Team sizes for some common splits (sizes never differ by more than one)
| Names | Teams | Team sizes |
|---|---|---|
| 10 | 2 | 5, 5 |
| 10 | 3 | 4, 3, 3 |
| 11 | 3 | 4, 4, 3 |
| 12 | 5 | 3, 3, 2, 2, 2 |
| 13 | 4 | 4, 3, 3, 3 |
| 20 | 6 | 4, 4, 3, 3, 3, 3 |
| 25 | 4 | 7, 6, 6, 6 |
| 30 | 7 | 5, 5, 4, 4, 4, 4, 4 |
Frequently asked questions
How does the team randomizer decide who goes where?
It shuffles the list with a fair shuffle (Fisher-Yates) driven by your browser's secure random generator and deals the shuffled names into teams. With no rules and no captains, every possible split into those team sizes is equally likely.
Can the teams have different sizes?
Only by one person at most. With 10 names in 3 teams you get 4, 3 and 3. A split such as 5, 3 and 2 is never made, even by chance. If you want some other shape, make the teams you want by hand.
How do I keep two people on the same team?
Write their names on one line of the Rules box with a plus sign between them: Kasun Perera + Nimali Fernando. Add more names with more plus signs to keep three or more together. The locked group must fit inside the biggest team.
How do I keep two people apart?
Write their names with a vertical bar between them: Ruwan Bandara | Dilini Wickramasinghe. With three names, A | B | C, all three go on different teams. You need at least as many teams as the number of people you keep apart.
How do captains work?
The first names in your list are the captains. Set Captains to how many you want, up to the number of teams. They always go on different teams, are marked, and are listed first in their team.
Why do I get a message that my rules are impossible?
The rules cannot all be true together. Typical causes are a locked group bigger than the biggest team, two people who are locked together and also kept apart, or more people to keep apart than there are teams. The message names the problem. Remove a rule or change the number of teams.
I pressed Shuffle again and two people are still together. Is it broken?
That happens by chance. In 12 names split into 4 teams of 3, two particular people share a team with chance 2/11, about 18.2%, on every shuffle. Keeping teams exactly as before would be the suspicious result.
Are my names sent to a server?
No. The names are split in your browser tab, nothing is uploaded or stored, and closing the tab clears the list.
Can I split by team size instead of the number of teams?
Yes. Choose People per team and enter the largest size you want. The tool makes the smallest number of teams that fits and shares the people evenly, so with 13 names and a size of 4 you get 4 teams of 4, 3, 3 and 3.
Sources & references
- Fisher-Yates shuffle, including the biased naive version - Wikipedia
- Crypto: getRandomValues() method - MDN
- Simple random sample - Wikipedia
- List of mammals of Sri Lanka - Wikipedia (checked for the wildlife team names)
- List of reptiles of Sri Lanka - Wikipedia (checked for the wildlife team names)
- List of birds of Sri Lanka - Wikipedia (checked for the wildlife team names)
Updated Oct 15, 2026