What this tool does
You paste a list of people, tell the tool how many teams you want (or how many people should be on each team), and it hands back teams whose sizes differ by at most one person. It suits classroom group work, a five-a-side football night, a company offsite, a board-game evening, or any situation where "pick your own team" would start an argument. The list is processed in your browser only; nothing is uploaded or stored.
How the shuffle works
The names are first shuffled with the Fisher–Yates algorithm. Starting from the last position, each item is swapped with an item chosen uniformly from the positions up to and including its own. Every one of the n! possible orderings is then equally likely. The shuffled list is dealt out like a hand of cards: first name to Team 1, second to Team 2, and so on, wrapping around after the last team. Finally, the order of the teams themselves is shuffled once more. Without that last step the leftover people would always land on the lowest-numbered teams, and "Team 1 is always the big one" would be a built-in bias.
The random numbers come from the browser's crypto.getRandomValues where it exists, combined with rejection sampling so that picking an index in the range 0 to i has no modulo bias. If a very old browser lacks that API, the tool falls back to Math.random(). Be clear about what that means: for splitting a class or a football squad, either source is far more than good enough, but neither this tool norMath.random() should ever be used for anything that has to resist an attacker, such as passwords, tokens, or lottery draws with real money at stake. For secrets, use a purpose-built tool like thepassword generator or theUUID generator.
What happens when the numbers do not divide evenly
With n people and k teams, let q be the whole-number quotient of n divided by k and r the remainder. Thenr teams have q + 1 people and the other k − r teams have q people. The sizes can never be closer together than that, so this is the most even split possible. Which teams receive the extra person is decided at random. If you choose "People per team" instead, the tool rounds the number of teams up (ceiling of n divided by the team size) and then applies the same rule. Eleven people at "4 per team" therefore become 3 teams of 4, 4 and 3 — not a fixed 4-4-3 order, since which team ends up short is random too.
| People (n) | Teams (k) | Team sizes | Two specific people on the same team | For comparison: 1/k |
|---|---|---|---|---|
| 10 | 2 | 5 people Γ 2 | 44.44% | 50.00% |
| 10 | 3 | 4 people Γ 1 + 3 people Γ 2 | 26.67% | 33.33% |
| 7 | 3 | 3 people Γ 1 + 2 people Γ 2 | 23.81% | 33.33% |
| 17 | 3 | 6 people Γ 2 + 5 people Γ 1 | 29.41% | 33.33% |
| 23 | 4 | 6 people Γ 3 + 5 people Γ 1 | 21.74% | 25.00% |
| 25 | 5 | 5 people Γ 5 | 16.67% | 20.00% |
| 30 | 4 | 8 people Γ 2 + 7 people Γ 2 | 22.53% | 25.00% |
| 100 | 7 | 15 people Γ 2 + 14 people Γ 5 | 13.43% | 14.29% |
The probability column is the sum of s(s−1) over all team sizes s, divided by n(n−1). It sits slightly below the naive 1/k because team sizes are fixed: once one person takes a seat, there is one fewer seat left for the other.
Two checked examples
Example 1: 23 people into 4 teams. Here q = 5 and r = 3, so there are three teams of 6 and one team of 5 (6 + 6 + 6 + 5 = 23). The chance that two chosen people end up together is (3 × 6 × 5 + 1 × 5 × 4) / (23 × 22) = 110/506 = 21.74%.
Example 2: 10 people into 3 teams. Here q = 3 and r = 1, so one team has 4 people and two have 3 (4 + 3 + 3 = 10). Two chosen people share a team with probability (1 × 4 × 3 + 2 × 3 × 2) / (10 × 9) = 24/90 = 26.67%. The number of distinct ways to deal people into labelled teams is a multinomial coefficient: six people into three pairs is 6!/(2!×2!×2!) = 90, and the 10-into-3 case gives 4,200. A fair divider is simply one in which every one of those arrangements is equally likely.
Group balance mode
A purely random split can, by chance, put all the strong players, or all the seniors, on one team. If that matters, tick "Group balance" and write each line as Name, Group, for exampleMaria, A or Sam, beginner. The tool shuffles each group separately and then deals the groups one after another on the same continuous round-robin. As a result, each group is spread across the teams with at most one person of difference, and the overall team sizes stay within one person of each other. Four A-level, four B-level and four C-level players in four teams yields exactly one A, one B and one C per team. A line without a comma is treated as having no group. The tool guarantees the spreading; whether your A, B and C labels reflect real ability is up to whoever assigned them.
Why not let each person pick a team at random?
The simplest implementation gives every person an independent random team number from 1 to k. It is easy to write and a poor idea: team sizes then follow a binomial distribution. With 10 people and 2 teams, a perfect 5-5 split occurs with probability C(10,5)/210 = 252/1024, about 24.6%; the other three quarters of the time you get 6-4, 7-3 or worse. This tool avoids that by fixing the team sizes first and then filling the seats with a shuffled list.
Another popular shortcut is list.sort(() => Math.random() - 0.5). It looks like a shuffle but is not one, because the comparison function is inconsistent and the result depends on the browser's sorting algorithm. As a test, shuffling the three items [0, 1, 2] 600,000 times that way in one Node.js run produced the order 0,1,2 about 37% of the time and some orders only about 6% of the time, whereas a fair shuffle gives each of the six orders 16.7%. The exact figures depend on the engine, but the skew is real. In a team divider this kind of bias would mean the same people keep landing together, which is exactly what a random split is meant to prevent.
Choosing the number of teams
Start from what the activity needs. For discussion and project work, small groups of three to five keep everyone involved, and a free rider is easier to spot. For sports, the rules fix the number of players on the field, so count substitutes too: twelve people at "6 per team" gives two teams, but only if you are happy with no bench. If you also need a fixture list, an odd number of teams means somebody gets a bye in a knockout round. When the headcount is uncertain, confirm attendance first and only then paste the list. If someone drops out afterwards, it is usually better to move one person from a larger team than to reshuffle everybody, which would break the groupings people have already started working in.
Common mistakes
- Entering more teams than participants. That would create empty teams, so the tool refuses; keep the number at or below the head count.
- Mixing up "number of teams" and "people per team". Twenty people at "4 per team" make 5 teams; "4 teams" makes four teams of 5.
- Typos in group labels under group balance. "A" and "A " are the same after trimming, but "A" and "A-level" are two different groups.
- Names that contain a comma, such as "Kim, Jun". With group balance on, everything after the first comma is read as the group, so write such names another way.
Limits of a random split
- Fair process is not the same as balanced teams. Every arrangement is equally likely, but that does not mean the teams are equally strong. For mixed skill levels, rate people first and use group balance.
- Re-rolling until you like the result defeats the purpose. If you reshuffle after looking, your preference decides the outcome. Decide in advance how many times you will click, and use "Copy result" to record the final answer.
- Constraints are not supported. There is no "keep these two apart" or "these two must be together" option. If you swap people by hand afterwards, agree on the rule openly and accept that the split is no longer purely random.
- Duplicate names count as different people. A note under the input reports duplicates; label them, for example "Chris M." and "Chris T.", so you can tell them apart on the result.
- Small samples look streaky. In an 8-person, 2-team split, two named people are on the same team with probability 3/7 (about 42.9%). Landing together or apart on a given draw is not evidence of a rigged tool.
Privacy and related tools
Names never leave the page: the shuffle and the display happen in your browser and nothing is saved, so closing the tab erases the list. There is also no seed option, which means a result cannot be reproduced; copy it if you need a record. If you only need one winner or a speaking order, a plainrandom number generator is enough, and for drawing lots in a game setting the ladder game is a fun alternative. If you are also drafting a small word list for a quiz or a warm-up, theword counter helps check lengths.
Frequently Asked Questions
Will I get a different result if I split the same list again?
Yes. Each click on "Divide into Teams" reshuffles from scratch, so the same list produces a different split every time. Re-rolling until you like the outcome removes the fairness, so it is best to click once and keep the result.
How are blank lines and duplicate names handled?
Blank lines are ignored. Duplicate names are treated as separate people and each is placed independently; the note under the input box tells you how many duplicates it found.
What happens if the group does not divide evenly?
Team sizes differ by at most one. Twenty-three people in four teams give 6, 6, 6 and 5, and which team gets the smaller number is also random.
Can I make teams of similar strength?
Tick "Group balance" and add a rating after a comma on each line, such as "Alex, high" or "Sam, low". Each rating is then spread across the teams as evenly as the numbers allow. You decide the ratings yourself.
How many teams can I create?
At least 2 and at most the number of participants, up to a ceiling of 100 teams. In "People per team" mode the number of teams is computed for you, and a message appears if that would give fewer than two teams.
Can I paste the result somewhere else?
Click "Copy result" to place a plain-text list of teams on your clipboard, ready for a chat message or a document. If your browser blocks clipboard access, select the text on the page and copy it manually.