Random Team Picker

Paste your names, choose how many teams — or how big each team should be — and get a genuinely unbiased split, with the fairness math explained below.

Teams

Click “Shuffle teams” to make the split.

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() — overkill for gym class, but it means the picker is beyond suspicion, and being beyond suspicion is the entire job of a team picker. Nothing is uploaded; the list never leaves your screen.

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) = equal

The 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:

  1. Shuffle all 10 names — 10! = 3,628,800 orderings, each with probability 1/3,628,800
  2. Deal round-robin: positions 1, 4, 7, 10 → Team 1; positions 2, 5, 8 → Team 2; positions 3, 6, 9 → Team 3
  3. Sizes: 4 / 3 / 3 — 10 ÷ 3 leaves one extra, and only one team gets it
  4. 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 — the fairness is checkable, not asserted.

Assumptions & tips

  • Agree on the protocol before the click. First result stands, or best-of-three re-rolls — decided in advance. Re-rolling until the captains smile is choosing, not chance.
  • Balance skill separately from chance. Random is fair but not balanced. For pickup sports, a common hybrid: rank the two or four strongest players, place them 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? That's the spinner wheel — same unbiased RNG, one pick, more drama.

Frequently asked questions

Is this picker actually 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 subtle modulo bias that plagues 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.

What happens when the names don't divide evenly?

The remainder is spread one-per-team from the first team onward — 10 names into 3 teams gives 4-3-3, never 4-4-2. Because the shuffle happens before the split and team order is part of the shuffle, which team ends up with the extra player is itself random. If exact evenness matters for your activity, add a "sits out" name and treat that slot as the bench.

Can I re-run it until I like the teams?

You can, but then the teams aren't random anymore — they're your choice with extra steps. The honest protocols are: agree beforehand to accept the first result, or agree on a fixed number of re-rolls before anyone sees any result. Randomness is a social contract as much as a mathematical one.

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

  1. Web Cryptography API — World Wide Web Consortium (W3C) Recommendation, 26 January 2017. §10.2.1, the getRandomValues method. w3.orgDefines crypto.getRandomValues and its requirement to overwrite the array with cryptographically random values — the bit source every swap in this page's shuffle draws from.
  2. 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.
  3. 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.
  4. 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.
  5. 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.
  • 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 real math 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.