Random Team Picker — Split Names into Random Teams (Even/Custom)
Paste your roster, pick how many teams you need (2 through 10), and the page splits the names into balanced groups in one click. The algorithm shuffles every name first using a Fisher-Yates pass over Web Crypto entropy, then assigns names round-robin so the team sizes differ by at most one — that means a roster of 11 split into 4 teams comes out 3-3-3-2, never 5-2-2-2. Each team gets its own color-coded card so you can scan the result at a glance, and a single copy button puts the whole assignment on your clipboard ready to paste into a chat or whiteboard.
About this tool
The shuffle is an unbiased Fisher-Yates pass backed by crypto.getRandomValues — every permutation of the input list is equally likely, which matters when team strength is correlated with input order (alphabetical roster, skill-sorted lineup). After shuffling, names are placed into teams via index modulo team-count, which guarantees minimum-imbalance team sizes for any roster size and any team count from 2 to 10. Empty lines and surrounding whitespace are stripped before counting, so you can paste from any list source without sanitizing first. Refresh runs again with a new shuffle so you can re-roll if the first split clumps friends together. Common uses: PE class teams, kid-party games, hackathon squads, sports tournament drafts, group projects in school, and breaking a meeting into discussion subgroups.
- Paste names one per line — accepts trailing whitespace and blank lines
- Slider for 2 to 10 teams
- Fisher-Yates shuffle + round-robin assignment for minimum imbalance
- Web Crypto entropy (no Math.random bias)
- Color-coded team cards (10 distinct accent colors)
- Live name counter as you type
- Copy formatted output (team labels + bulleted names) to clipboard
- Refuses to split when roster has fewer names than teams
- No accounts, no analytics, no server roundtrip
- Suitable for PE class, kids parties, hackathons, school projects
Free. No signup. Your inputs stay in your browser. Ads via Google AdSense (consent required).
Frequently asked questions
Why round-robin instead of just assigning the first names to team A, next batch to team B?
Sequential block assignment (first M names → team A, next M → team B, etc.) gives the same minimum-imbalance team sizes as round-robin, but it leaks input-order information into team membership. If the roster is sorted alphabetically, team A gets everyone whose name starts with A-D and team B gets E-H — friends sitting next to each other on the roster end up on the same team. Round-robin (index modulo team-count after a Fisher-Yates shuffle) decorrelates the output from the input order: every permutation of the roster is equally likely, so the input order has zero influence on team membership. This is the canonical fair-partition approach used in sports drafts where draft order matters (snake drafts add a reverse pass for further fairness).
Why Fisher-Yates over a simpler sort-by-random-key approach?
The naive alternative is to give each name a random number and sort by that number. This works in theory but has two practical issues: (1) JavaScript's `Array.prototype.sort()` is not guaranteed to be a perfect-shuffle sort in all browsers — it uses TimSort (V8, since Chrome 70 in October 2018) which compares pairs and can be biased by tie-breaking when two random keys collide; (2) the per-element random key needs 32+ bits to avoid collisions, multiplying the entropy budget. Fisher-Yates (Knuth Algorithm P, the in-place adaptation by Durstenfeld CACM 1964 of the original Fisher & Yates 1938 pencil-and-paper version) generates an exact uniform permutation in O(n) time and O(1) extra space per swap — no sort, no tie-breaking, no entropy waste. This tool's `shuffle()` in `src/lib/random.ts` is the textbook Durstenfeld implementation backed by `crypto.getRandomValues()`.
How balanced are the team sizes — what if the roster doesn't divide evenly?
Team sizes always differ by at most 1, regardless of roster size or team count. The round-robin assignment (index modulo numTeams) guarantees this: a roster of 11 split into 4 teams comes out 3-3-3-2, never 5-2-2-2 or any other lopsided arrangement. The smaller teams are always the last ones in the index order (team D in the 11-into-4 example), but since the names were already shuffled before assignment, which exact team ends up with the extra absence is random. For sports leagues this is usually fine; for chore rotation where the smallest team has a clear advantage you might want to rotate which team gets the smaller size across sessions.
What if I want unequal team sizes (e.g., 1 captain plus 5 players each)?
This tool does equal-or-near-equal partitioning only. For role-based splits you can run it twice: first split into role tiers (say, captains vs players) by sorting the roster manually, then call the picker on each tier separately. Alternatively for very small team counts you can split manually after seeing the first result. The tool's UI sticks to 2-10 equal-or-near-equal teams because that is the dominant use case (PE class, hackathon squad assignment, classroom group projects, sports drafts) and adds enough complexity already; explicit unequal partitioning is rare enough that adding a UI for it would clutter the page for the 95 % of users who just want fair even teams.
Can I get a different split if the first one clumped friends together?
Yes — clicking "Pick teams" again re-shuffles. Each click runs a fresh Fisher-Yates pass over the same roster, producing an independent permutation. Mathematically there is no memory of the previous split: in expectation a second click changes a non-trivial fraction of team assignments (about 1 − 1/numTeams per name on average). If you want to avoid a specific pairing showing up at all across re-rolls ("these two should never be on the same team"), the cleanest solution is to remove one of them, run the picker, then add them to the opposite team manually — explicit constraints are usually faster to express by editing the roster than by adding UI for them.
Sources (5)
- Fisher, R. A., & Yates, F. (1938). Statistical Tables for Biological, Agricultural and Medical Research — original (pencil-and-paper) shuffle: write the numbers 1..N, draw a random number between 1 and N-k+1, strike out the k-th unstruck number and append it to the output list; this tool uses Durstenfeld's 1964 in-place computer adaptation (named Algorithm P by Knuth) of the same procedure — every permutation of the input roster is equally likely. Oliver and Boyd, London and Edinburgh (1938, viii + 90 pp.); original shuffle procedure described as "Example 12".
- Knuth, D. E. (1997). The Art of Computer Programming, Volume 2: Seminumerical Algorithms — §3.4.2 Algorithm P (Shuffling) — the in-place O(n) variant this tool uses; runs through the array from the last element down, swapping each element with a uniformly chosen index in the unshuffled prefix; the round-robin assignment afterwards (i-th shuffled name → team i mod numTeams) guarantees team sizes differ by at most one for any roster size. Addison-Wesley, 3rd edition (1997, ISBN 0-201-89684-2); §3.4.2 first published in 1st edition 1969.
- Durstenfeld, R. (1964). Algorithm 235: Random permutation — in-place computer-friendly shuffle that Knuth later named Algorithm P; the modification of Fisher & Yates 1938 that brings the algorithm down from O(n²) to O(n) by swapping the chosen element to the end of the working region rather than physically striking it out from a paper list. Communications of the ACM, Vol. 7, No. 7, p. 420 (July 1964).
- World Wide Web Consortium (W3C) (2017). Web Cryptography API — `crypto.getRandomValues()` powers the shuffle in this tool via the in-tree `src/lib/random.ts` helper, which uses rejection sampling on a Uint32Array to draw unbiased indices for each swap; this matters when team strength is correlated with input order (alphabetical roster, skill-sorted lineup) because biased shuffles would systematically stack better players into low-index teams. W3C Recommendation 26 January 2017 (Crypto.getRandomValues §3.3).
- World Wide Web Consortium (W3C) (2018). Web Content Accessibility Guidelines (WCAG) 2.1 — Success Criterion 4.1.3 Status Messages — the rendered team cards update via `aria-live="polite"` so screen-reader users hear the outcome when "Pick teams" is activated; SC 1.4.3 Contrast (Minimum) governs the colored team-card accents (each accent meets 3:1 against the dark surface per the WCAG 2.1 relative-luminance formula). W3C Recommendation 5 June 2018; carried unchanged into WCAG 2.2 (Recommendation 5 October 2023).
These are the original publications the formulas in this tool are based on. Locate them by journal name and year on Google Scholar or PubMed.
By Marco B. ·