Random Team Picker
Paste your names, choose how many teams (or how big each team should be), and get an unbiased split, with the fairness math explained below.
How this calculator works
Paste or type your list (line breaks, commas, or semicolons all work as separators), pick whether you're dividing into a set number of teams or teams of a set size, and click the button. The tool shuffles the entire list once with an unbiased shuffle, then deals the shuffled names round-robin into teams like dealing cards. Shuffling first and dealing second is what makes every possible team arrangement equally likely, including which team ends up larger when the split is uneven.
Randomness comes from the browser's cryptographic generator rather than the ordinary Math.random(). That is more than gym class needs, but it means nobody can predict or steer the result. Nothing is uploaded: the list stays in your browser.
The formula
Fisher–Yates shuffle:
for i from n−1 down to 1:
j ← unbiased random integer in [0, i]
swap a[i], a[j]
Unbiased integer (rejection sampling):
draw 32 random bits; redraw if ≥ ⌊2³² / n⌋ × n; result mod n
Teams: deal shuffled names round-robin into k teams
→ sizes differ by at most 1; P(any particular arrangement) = equalThe shuffle is Algorithm P in Knuth's The Art of Computer Programming, Vol. 2, the standard proof that it produces every permutation with probability 1/n! exactly. Random bits come from crypto.getRandomValues (W3C Web Cryptography API), and the rejection step removes the modulo bias described in the FAQ.
Worked example
Split the default 10 names into 3 teams:
- Shuffle all 10 names: 10! = 3,628,800 orderings, each with probability 1/3,628,800
- Deal round-robin: positions 1, 4, 7, 10 → Team 1; positions 2, 5, 8 → Team 2; positions 3, 6, 9 → Team 3
- Sizes: 4 / 3 / 3, 10 ÷ 3 leaves one extra, and only one team gets it
- Any specific person lands on Team 1 with probability 4/10, Teams 2 or 3 with 3/10 each
Run it and count: each team's size always matches this arithmetic, and across many shuffles each name spends about 40% of the time on the bigger team.
Assumptions & tips
- Agree on the protocol before the click. Decide in advance whether the first result stands or you will allow re-rolls.
- Balance skill separately from chance. A random split is fair but not necessarily balanced. For pickup sports, a common approach is to place the two or four strongest players by hand and randomize everyone else.
- Uneven numbers: rotate the bench. Add "sits out first" as a name and let the shuffle assign it. The bench becomes part of the same fair draw.
- Duplicates are allowed and meaningful. The picker treats two identical names as two people. If you paste a list twice by accident, you'll get everyone twice. Check the count in the result line.
- Need one winner instead of teams? Use the spinner wheel, which draws from the same random generator.
Frequently asked questions
Is this picker fair?
Yes, in a precise sense: every possible arrangement of names is exactly equally likely. It uses the Fisher–Yates shuffle driven by the browser's cryptographic random number generator, with rejection sampling to avoid the modulo bias found in naive implementations. Nobody (including the person clicking the button) can influence or predict the outcome.
What is modulo bias, and why should I care?
The lazy way to get a random number from 0 to n−1 is "random byte mod n", but 256 doesn't divide evenly by most n, so low values come up slightly more often. For picking teams the skew is small. The reason to care is principle: a picker that is almost fair invites arguments, and doing it right costs three lines of code. This tool discards out-of-range values and redraws, which removes the bias entirely.
Does the picker store or send my list anywhere?
No. The names live only in the text box on your screen. The shuffle runs entirely in your browser, and nothing is transmitted or saved. Reload the page and the list is gone.
Sources
- Web Cryptography API. World Wide Web Consortium (W3C) Recommendation, 26 January 2017. §10.2.1, the getRandomValues method. w3.orgDefines
crypto.getRandomValuesand its requirement to overwrite the array with cryptographically random values: the bit source every swap in this page's shuffle draws from. - FIPS 186-5: Digital Signature Standard (DSS). National Institute of Standards and Technology, 3 February 2023. Appendix A.4, Random Values Mod n. nvlpubs.nist.govSets out plain modular reduction (A.4.1) against the discard method (A.4.2): the standards-body version of the modulo-bias argument in the FAQ, and the reason this page redraws out-of-range values instead of taking a remainder.
- Fast Random Integer Generation in an Interval. Daniel Lemire, ACM Transactions on Modeling and Computer Simulation, volume 29, number 1, pages 1–12, 2019. DOI 10.1145/3230636. arxiv.orgAnalyses the bias introduced by taking a modulus of random words and the rejection bound that removes it: the exact technique in this page's unbiased-integer routine. Linked to the author's arXiv copy; the published version sits behind the ACM paywall.
- The Art of Computer Programming, Volume 2: Seminumerical Algorithms. Donald E. Knuth, 3rd edition, Addison-Wesley, 1997. §3.4.2 (Random Sampling and Shuffling), Algorithm P. Algorithm P, the shuffle this page runs, and the proof that it yields each of the n! orderings with probability 1/n!, the fairness claim made in the formula section. Cited bibliographically: no free full text to link.
- Algorithm 235: Random permutation. Richard Durstenfeld, Communications of the ACM, volume 7, number 7, page 420, 1964. DOI 10.1145/364520.364540. The in-place, linear-time formulation of the Fisher–Yates shuffle (swapping backwards from the end of the list) that the code implements. Cited bibliographically: the ACM Digital Library copy is not freely readable.
Related calculators
Spinner Wheel
Add your options, spin the wheel, get a fair pick. The result comes from an unbiased RNG, not the animation.
Coin Flip
Flip one coin or twenty: fair 50/50 flips with a running tally, streak tracking, and the probability of runs.
Blackjack Odds Calculator
Exact dealer bust rates by upcard and the true EV of standing, hitting, or doubling any hand.
Poker Odds Calculator
Outs to exact turn and river odds, the rule of 2 & 4 checked, and pot-odds break-evens for Hold’em.