Random team generator

Paste your list of names, one per line, choose whether you want a fixed number of teams or a fixed team size, and generate a shuffled, balanced split. Re-shuffle as many times as you like, then copy the result.

How it works

Two separate steps run every time you click Generate or Re-shuffle.

Step 1 — shuffle

The name list is shuffled with a Fisher–Yates shuffle: walk the list backwards from the last position, and at each position swap it with a random position at or before it. Done correctly, every possible ordering of the list is equally likely — there is no bias toward names that started near the top or bottom.

for i from last index down to 1: j = random integer in [0, i] swap list[i] and list[j]

Step 2 — partition

The shuffled list is then split according to whichever mode is selected:

  • Number of teams divides the roster into exactly N groups. Any remainder — the names left over after dividing evenly — is given out one per team to the first teams, so no team differs from another by more than one player.
  • Players per team fills teams to a fixed size K, one at a time. Every team gets exactly K players except the last, which takes whatever is left.

These are two different, equally valid notions of “fair.” Number of teams keeps every team the same size to within one player. Players per team keeps every team the same size except the last one. Pick whichever matches the constraint you actually have — a fixed number of stations, or a fixed roster size per side.

Worked examples

Both examples below are exactly what the partitioning logic produces — check them with the tool above.

1. Seven names, three teams (number-of-teams mode)

7 ÷ 3 = 2 remainder 1. Two teams get the base size of 2, and the one leftover name goes to the first team.

Team 1: 3 players Team 2: 2 players Team 3: 2 players

Sizes: 3, 2, 2. Every name appears on exactly one team; none is dropped and none repeats.

2. Ten names, teams of four (players-per-team mode)

10 ÷ 4 = 2 full teams of 4, with 2 names left over for a final, smaller team.

Team 1: 4 players Team 2: 4 players Team 3: 2 players

Sizes: 4, 4, 2. Note this is a different split shape from the number-of-teams example above, even though both start from an "evenly as possible" rule — the fixed quantity is the team size here, not the team count.

Frequently asked questions

Is the shuffle truly random, or can I predict the outcome?

It uses a Fisher–Yates shuffle driven by your browser's Math.random(). That produces an unbiased, unpredictable ordering for everyday use — picking a scrimmage side, sorting a classroom into groups, deciding who is on which quiz team — but it is pseudo-random, not cryptographically secure. Do not use it for anything with money or legal stakes riding on the outcome, such as a paid raffle or a contract-bound draw.

Why don't my team sizes come out perfectly equal?

They do, to within one player, whenever the roster doesn't divide evenly. Splitting 7 names into 3 teams cannot give three equal groups, so the generator gives sizes 3, 2 and 2 — the single extra person goes to one team rather than every team being stuck with a leftover, and no team is ever forced to take the entire remainder on its own.

What is the difference between choosing a team count and a team size?

Number of teams fixes how many teams you end up with and lets the size of each team flex by at most one player — good when you know you need exactly 4 groups for 4 stations. Players per team fixes how many people go on each team and lets the number of teams flex — good when you know each team needs exactly 5 players for a 5-a-side game. The two modes can give different-looking splits from the same list, and both are correct for what they were asked to do.

What happens if I ask for more teams than I have names?

The generator caps the team count at the number of names, so you never end up with empty teams. Ask for 8 teams from a list of 5 names and you get 5 teams of 1 — the tool tells you it did this rather than silently showing fewer teams than you requested.

Does this generator balance teams by skill level?

No — deliberately not. It only balances team size, not ability, seniority, experience or any other attribute, because it has no information about any of those things and has no way to know them from a name alone. If you need skill-balanced teams, sort your list into skill tiers yourself first and run each tier through the generator separately, or seed the strongest players onto different teams by hand before shuffling the rest.

Can two people have the same name on the list?

Yes. Duplicate lines are kept exactly as entered and treated as two separate people — the generator has no way to know that two “Sam” lines are the same person or different people, so it never removes or merges a line on your behalf. If you need to tell them apart, add a last initial or a number to each line before generating.

Can I get a different split without retyping the names?

Yes — the names stay in the box after you generate. Press Re-shuffle to run a brand-new Fisher–Yates shuffle and a fresh split over the same list, as many times as you like, without touching the textarea.

Does the list of names get sent anywhere or saved?

No. The shuffle and the split both run in your browser's own JavaScript engine. Nothing you type is uploaded, logged or stored — reload the page and the list is gone, exactly like a piece of scratch paper.

Use cases & limitations

Where this is genuinely useful

  • PE class and gym sessions. Split a roster into a fixed number of squads for stations, or into fixed-size sides for a scrimmage, without the same two friends always ending up together.
  • Recreational sports leagues. Quickly draw fair-sized pickup teams for five-a-side, volleyball rotations or a Sunday league night.
  • Group projects and classroom activities. Assign students to discussion groups or project teams in a way nobody can argue was rigged toward a particular pairing.
  • Game night and trivia. Split a mixed group of friends into balanced-size teams for a quiz or board game in seconds.

What this tool cannot do

  • It does not balance skill, seniority or any other attribute — only team size. A name carries no information about ability, so the tool has nothing to balance against.
  • It is not cryptographically random. Math.random() is good enough for splitting up a kickball game; it is not suitable for anything where the fairness of the draw has money, legal standing or a formal competition ruling attached to it.
  • It cannot keep specific people apart or together. Every name has an equal, independent chance of landing on any team — there is no "these two must never be on the same team" constraint.
  • Nothing is saved between visits. Refreshing the page clears the list, by design.