What this tool does
The Random Team Generator splits a roster of people into a chosen number of teams as evenly as possible. After a random shuffle of names, the list is partitioned into groups: some groups hold the larger size and the rest hold the smaller size, so no team is ever more than one person bigger than another.
How to use it
Enter the total number of people and how many groups you want. The calculator returns the people-per-group range, the largest and smallest group sizes, and exactly how many groups get the extra member when the numbers don't divide evenly.
The formula explained
For n people and g groups, the smallest group size is \(\left\lfloor n/g \right\rfloor\) and the largest is \(\left\lceil n/g \right\rceil\). The remainder \(r = n \bmod g\) tells you how many groups receive one extra person. Those \(r\) groups are the larger ones; the remaining \(g - r\) groups are smaller. When n divides g evenly, the remainder is 0 and every group is the same size.
$$\begin{gathered} \text{Min Size} = \left\lfloor \frac{\text{People}}{\text{Groups}} \right\rfloor, \quad \text{Max Size} = \left\lceil \frac{\text{People}}{\text{Groups}} \right\rceil \\[1.5em] \text{where}\quad \left\{ \begin{aligned} \text{Larger Groups} &= \text{People} \bmod \text{Groups} \\ \text{Smaller Groups} &= \text{Groups} - \left(\text{People} \bmod \text{Groups}\right) \end{aligned} \right. \end{gathered}$$
Worked example
Split 23 people into 4 groups. \(\left\lfloor 23/4 \right\rfloor = 5\) and \(\left\lceil 23/4 \right\rceil = 6\), so groups hold 5 or 6 people. The remainder is \(23 \bmod 4 = 3\), so 3 groups have 6 people and 1 group has 5 people. Check:
$$3\times6 + 1\times5 = 18 + 5 = 23 \checkmark$$
FAQ
Are the teams always equal? Only when people divides evenly by groups. Otherwise sizes differ by at most one person.
What if I ask for more groups than people? The number of groups is capped at the number of people, so each group has at least one member.
Is the assignment random? The model shuffles names first, then partitions sequentially, so membership is randomized while sizes stay balanced.