Paste a list, pick the number of teams, and get sizes that differ by 1 at most
This random team generator shuffles a list of names and places everyone on a team, with nobody left out. You choose how many teams you want, or the largest team you will allow, and the biggest and smallest teams will never differ by more than 1 person. Who ends up where is settled at the moment you press the button, so even the person running the session can't know it in advance.
When headcount alone isn't enough, use Balance by. Add a group after each name (department, class, gender) and every group is spread across the teams. Add a skill score instead and the teams are split so their totals come out close. If two people must be together or apart, put them in the rules box. Before you split, the board shows the empty seats for each team; afterwards each team gets a bar showing its group mix or score total.
Why draw teams at random instead of picking them
When the organizer picks the teams, someone always asks "why am I stuck with them?" When people pick for themselves, friends cluster together and the same person is always chosen last. If you announce the rules first (number of teams, what to balance, any restrictions) and split on a screen everyone can see, nobody can say the organizer tilted the result. Typical uses:
- Group projects in class: split a class of 25 into groups of 4, and keep two students who distract each other on different groups.
- Team-building and workshops: if people from the same department end up together, conversations stay narrow. Enter the department as the group and every table gets a mix.
- Pickup basketball or five-a-side: when the strongest players pile onto one side the game is over early, so give everyone a score from 1 to 5 and match the totals.
- PE class and field-day relays: use grade or homeroom as the group so each team has students from every one.
- Partner activities: set the maximum per team to 2. With an odd headcount one person is left alone, so enter half the headcount (rounded down) as the team count instead and exactly one team gets 3.
How to use it
- Paste the names into Names, one per line. Commas on a single line work too. The headcount appears above the box, so you can check it against the real number.
- Under Split by, choose a team count or a maximum per team and type the number. A preview such as "16 people → 4 teams, 4 each" appears next to it, and the board below draws that many empty seats per team.
- If only the sizes matter, leave Balance by on "Headcount only". To balance groups or skill, press "Groups" or "Skill score" and add
/ groupor/ scoreafter each name. - If you need them, open Same-team and different-team rules and write one set of names per line. Turn on "Team leaders" to pick one leader per team. To build suspense for the room, choose a Reveal style: "One by one" seats people as if dealing cards, "In 5 sec" keeps the names changing in every seat for five seconds before they all stop, and "Team by team" keeps the cards face down until you open them. Sound effects play only if you turn them on.
- Press Make teams. Click a team's heading to rename it, or press Pick team names for color, animal, fruit or planet names; Pick turn order numbers the teams for presentations or games. Then use "Copy result" or "Save TXT" to paste the teams into a group chat or an announcement. "Reshuffle" splits again from scratch.
If you copy a name column and a group (or score) column from Excel or Google Sheets, the tab between them is read as name and tag. A number column in front would be read as the name, so start the selection at the name column.
Team sizes come from a quotient and a remainder
With N people and K teams, every team first gets the quotient of N ÷ K, and the leftover people are added one per team. So each team has either the quotient or the quotient plus 1, and no team is ever empty. If you set a maximum size M instead, the number of teams is N ÷ M rounded up, then the same split applies. The maximum is a ceiling, not a target: 10 people with a maximum of 4 become 4·3·3, not 4·4·2.
| People | Input | Teams | Team sizes |
|---|---|---|---|
| 12 people | 3 teams | 3 | 4·4·4 |
| 10 people | 3 teams | 3 | 4·3·3 |
| 10 people | max 4 | 3 | 4·3·3 |
| 13 people | max 4 | 4 | 4·3·3·3 |
| 25 people | max 4 | 7 | 4·4·4·4·3·3·3 |
| 31 people | max 6 | 6 | 6·5·5·5·5·5 |
| 27 people | max 2 (pairs) | 14 | 13 × 2, 1 × 1 |
As the last row shows, pairing an odd number of people leaves one person alone. To avoid that, enter 13 teams so that exactly one team has 3. Which teams get the extra person is random each time, and team numbers are only labels, not rankings.
Balancing by group: a group's size differs by 1 at most between teams
With "Groups", people who have the same tag form one group. The tool goes through the groups from largest to smallest, shuffles the people inside each one, and places them one at a time on the team that has the fewest from that group, and among those the team with the fewest people overall. That keeps team sizes within 1 of each other and gives every team either its share of each group or one more. People with no tag form a single "No group" group and are spread the same way. Tags that differ only in capitalization (A and a) count as the same group.
| Group | People | Group size ÷ 4 | Per team |
|---|---|---|---|
| Sales | 5 | quotient 1, remainder 1 | 1 on three teams · 2 on one |
| Dev | 5 | quotient 1, remainder 1 | 1 on three teams · 2 on one |
| Design | 3 | quotient 0, remainder 3 | 1 on three teams · 0 on one |
| Planning | 3 | quotient 0, remainder 3 | 1 on three teams · 0 on one |
Three designers can't cover four teams, so one team has none. For that team the tool adds an extra person from Sales or Dev so it still has 4. The group mix of each team shows as a colored bar under its card, and the legend above lists the group sizes with a note that every group stays within 1 person from team to team.
Balancing by skill: teams with similar score totals
With "Skill score", the whole number from 0 to 100 after each name is used to make the team totals close. A simple scale like 1 to 5 is easiest, and everyone has to be rated by the same yardstick or the result means little. The tool first places people from the highest score down, each on the team with the fewest people (or, on a tie, the lowest total; equal scores are shuffled). Then it tries swapping two people from different teams and keeps every swap that narrows the gap between totals. A swap never changes team sizes, so the 1-person size rule still holds.
The swap step exists because placing high scores first on the lowest total doesn't always give the closest result. In an example from Korf (2009) on number partitioning, five players scoring 8, 7, 6, 5 and 4 go onto two teams as 8·5·4 (17) and 7·6 (13), a gap of 4. Splitting them as 4·5·6 (15) and 7·8 (15) leaves no gap at all.
| Method | Team of 3 | Team of 2 | Gap |
|---|---|---|---|
| Highest score first, onto the lower total | 8·5·4 = 17 pts | 7·6 = 13 pts | 4 |
| Then swap the 8 and the 6 | 6·5·4 = 15 pts | 8·7 = 15 pts | 0 |
Splitting numbers into equal sums is a known NP-complete problem, so for a big list, checking every possible split to find the single best one isn't realistic. This tool narrows the gap with swaps and shows the lowest total, the highest total and the gap in the legend after each split. If you don't like the gap, press Reshuffle. People with equal scores are placed at random, so each reshuffle can produce a different mix.
Same-team and different-team rules
Each line in a rules box is one set of names separated by commas. Everyone on a "Keep on the same team" line lands on one team, and everyone on a "Keep on different teams" line is spread over different teams. Names must match the list exactly. If the list has the same name twice, the tool can't tell which person you mean, so that name can't be used in a rule; write them as "Sam A" and "Sam B" in the list instead.
- Same-team sets that chain together: if you write "Jacob, Sophie" and then "Sophie, Ryan", all three have to share a team. If a chain is larger than the biggest team, the tool says the split is impossible.
- More people to separate than there are teams: you can't put 4 people on 4 different teams when there are only 3, so this is reported as an error.
- Two rules that collide: if two people are in a same-team set and also in a different-team set, both can't be true at once.
The rules are met by checking the first random split and swapping two people wherever a rule is broken. When groups are balanced and rules are used together, the rules come first. If a rule pushes a group more than 1 person off balance, the legend says so.
How the shuffle works, and what reshuffling changes
The random numbers come from the browser's Web Crypto API (crypto.getRandomValues). When a 32-bit number is turned into a range such as "one of 12 people", the uneven tail that doesn't divide evenly is thrown away and redrawn, so nobody is picked more often than anyone else. The ordering uses the Fisher–Yates shuffle described in the NIST dictionary of algorithms: each position is swapped with a random position from itself to the end. With "Team leaders" on, one person per team is chosen the same way, so everyone on a team has an equal chance.
"Reshuffle" splits again from scratch. It doesn't promise a different grouping from last time, so some people can land together again, and with a small list the whole arrangement could even repeat. Whichever reveal style you pick, the result is fixed the moment you press the button; the effect only changes how it is shown. The names changing in the seats during "In 5 sec" are just an animation, and "Show all" or "Reveal all" displays the same result at once. "Pick turn order" shuffles the teams with the same random source.
Common mistakes
- A title line counted as a person: a first line like "Year 10 class list" counts as one name because it isn't empty. If the headcount is higher than expected, check the first line.
- Commas inside names: a comma separates people, so "Smith, Sam" becomes two. Remove the comma or replace it with a space.
- Reading the maximum as a fixed size: a maximum of 4 doesn't mean every team has 4. For identical sizes, enter a team count that divides the headcount evenly.
- Scores on different scales: if one person rates out of 10 and another out of 5, the totals can match while the real strength doesn't.
- Group tags spelled differently: "Sales" and "Sales team" are different groups. If the legend shows more groups than you expect, make the tags consistent.
- Reshuffling until you like it: if you keep drawing until you get the teams you wanted, the randomness no longer means anything. If you run the draw together with others, agree beforehand which result you will use.
Limits of this tool
- 2 to 200 people, names up to 60 characters, group names up to 20 characters, and scores that are whole numbers from 0 to 100. The whole list can be up to 30,000 characters.
- It can't balance groups and skill at the same time. Pick whichever matters more.
- The skill balance narrows the gap by swapping, so it doesn't guarantee the smallest possible gap. Judge by the gap shown with the result.
- It doesn't remember earlier rounds, so it can't keep the same people from meeting again.
- The list and results exist only on this screen. Nothing is saved or sent to a server, everything disappears when you reload, and there is no share link, so copy the result or save it as TXT to pass it on.
- In a very old browser without Web Crypto, it falls back to ordinary random numbers (Math.random). The tool doesn't certify the fairness of an official draw.
As of October 22, 2026. The shuffle procedure, the random numbers and the number-partitioning problem were checked against the sources below.
Sources
- 01NIST Dictionary of Algorithms and Data Structures: Fisher-Yates shuffleThe procedure that shuffles N items by swapping each with a random item at or after its position
- 02MDN: Crypto.getRandomValues()Cryptographically strong random numbers supplied by the browser
- 03W3C: Web Cryptography APIThe browser standard that defines getRandomValues
- 04Lemire, D. (2019). Fast Random Integer Generation in an Interval. ACM TOMACS 29(1)How to turn random bits into an integer in a fixed range without bias
- 05Korf, R. E. (2009). Multi-Way Number Partitioning. IJCAI-09Splitting numbers into near-equal sums is NP-complete; includes the example of 8, 7, 6, 5 and 4 placed greedily
Frequently asked questions
What happens when the people don't divide evenly into the teams?
Every team gets the quotient of people ÷ teams, and the leftover people are added one per team. Splitting 10 people into 3 teams gives 4, 3 and 3, so the biggest and smallest teams differ by 1. Which teams get the extra person is random.
I set a maximum of 4 for 10 people. Why 4·3·3 and not 4·4·2?
The maximum is a ceiling, not a size every team has to reach. The tool first rounds 10 ÷ 4 up to 3 teams, then splits as evenly as possible into 4, 3 and 3. For identical team sizes, enter a team count that divides the headcount evenly.
How do I stop one department or gender from piling onto a team?
Under Balance by, choose Groups and add the group after each name, for example "/ Sales". Each group is spread so it differs by 1 person at most from team to team. You can also copy a name column and a group column from a spreadsheet and paste them together.
How should I enter skill scores?
Add a whole number from 0 to 100 after each name, such as "/ 4". A simple scale like 1 to 5 is easiest, and everyone must be rated by the same yardstick. The tool makes the team totals close and shows the lowest total, the highest and the gap with the result.
Can I keep two people on the same team or on different teams?
Open the same-team and different-team rules and write one set of names per line, separated by commas. Everyone on a "same team" line goes together, and everyone on a "different teams" line is spread out. If a rule can't be met because a set is bigger than a team or than the number of teams, you're told why.
What if two people on the list have the same name?
They are treated as different people and shown with their entry number, like "Sam (entry 3)". A repeated name can't be used in a rule because it's unclear who you mean, so write them as "Sam A" and "Sam B" if you need a rule.
Will reshuffling give me different teams from before?
Reshuffling splits again from scratch, so a different grouping isn't guaranteed. Some people may land together again, and with a short list the whole arrangement could repeat. The tool doesn't remember earlier rounds to avoid repeats.
Is my list saved or sent to a server?
No. The list and results are handled only in this browser, nothing is saved or sent, and everything disappears when you reload the page. To keep a result, use Copy result or Save TXT. No share link is created.