# Team Randomizer - Split Names into Balanced Random Teams

Page: https://hirantha.me/tools/team-randomizer
Part of: Hirantha Sandaruwan Lakshan free tools (https://hirantha.me/tools)
Updated: 2026-10-15

Split a list of names into balanced random teams by team count or team size, with optional captains, people to keep together and people to keep apart.

This is a free tool that runs in the browser: open the page to use it. File tools process files on the visitor's own device; files are never uploaded or stored. No account, sign-up, payment or watermark.

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. 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.

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.

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 |

Q: How does the team randomizer decide who goes where?
A: 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.

Q: Can the teams have different sizes?
A: 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.

Q: How do I keep two people on the same team?
A: 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.

Q: How do I keep two people apart?
A: 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.

Q: How do captains work?
A: 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.

Q: Why do I get a message that my rules are impossible?
A: 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.

Q: I pressed Shuffle again and two people are still together. Is it broken?
A: 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.

Q: Are my names sent to a server?
A: No. The names are split in your browser tab, nothing is uploaded or stored, and closing the tab clears the list.

Q: Can I split by team size instead of the number of teams?
A: 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: Fisher-Yates shuffle, including the biased naive version - Wikipedia (https://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle); Crypto: getRandomValues() method - MDN (https://developer.mozilla.org/en-US/docs/Web/API/Crypto/getRandomValues); Simple random sample - Wikipedia (https://en.wikipedia.org/wiki/Simple_random_sample); List of mammals of Sri Lanka - Wikipedia (checked for the wildlife team names) (https://en.wikipedia.org/wiki/List_of_mammals_of_Sri_Lanka); List of reptiles of Sri Lanka - Wikipedia (checked for the wildlife team names) (https://en.wikipedia.org/wiki/List_of_reptiles_of_Sri_Lanka); List of birds of Sri Lanka - Wikipedia (checked for the wildlife team names) (https://en.wikipedia.org/wiki/List_of_birds_of_Sri_Lanka)

Related tools:

- [Random name picker](https://hirantha.me/tools/random-name-picker.md): Paste a list of names and pick one or more winners fairly, with optional extra chances, a spinning reveal, a history and winners removed after each draw.
- [Random number generator](https://hirantha.me/tools/random-number-generator.md): Pick random whole numbers or decimals in any range, with or without repeats, drawn fairly from your browser's secure random number generator.
- [Remove duplicate lines](https://hirantha.me/tools/remove-duplicate-lines.md): Remove duplicate lines from a list and see how many were removed. Keep the first or last copy, ignore case or spaces, or show only the repeated or only the unique lines.
- [Sort lines (A to Z, numeric, shuffle)](https://hirantha.me/tools/sort-lines-tool.md): Sort lines A to Z, Z to A, by number or by length, or reverse and shuffle them. Natural number order, case options and language-aware sorting, live as you type.
- [Coin flip](https://hirantha.me/tools/coin-flip.md): Flip a fair coin online: heads or tails with a running tally, a streak counter and up to 1,000 coins at once, from your browser's secure generator.
