Random group generator
Give it a list and a number of groups. It shuffles properly and deals round-robin, so the groups differ by at most one person and nothing is left over.
Why the groups come out even
Most splitters chop a shuffled list into equal chunks and hand whatever is left to the final group. With ten people in three groups that produces four, four and two — and the group of two knows it was an afterthought.
Dealing solves it. The shuffled list is handed out one at a time, like cards, so ten people in three groups become four, three and three. No group is ever more than one person larger than another, whatever the numbers.
That property is worth stating precisely because it is checkable: for any list of any length split into any number of groups, the largest and smallest group differ by at most one. It is asserted in this site's tests rather than claimed in its copy.
The shuffle underneath
A list is only randomly grouped if it was properly shuffled first, and the obvious way to shuffle — sorting by a random comparator — is measurably biased. Some orderings come up far more often than others, and with a class-sized list the bias is large enough to notice over a term.
This uses a Fisher-Yates shuffle, which visits each position once and swaps it with a uniformly chosen earlier one. Every ordering is exactly as likely as every other, which is the only version of "random" worth having when the same class is being split every week.
The randomness comes from the browser's cryptographic source, so re-running immediately gives a genuinely different arrangement rather than a variation on the last one.
Groups of a fixed size
Sometimes the constraint is the size of each group rather than how many groups there are — pairs for an exercise, fours for a table. Ask for a size instead and the number of groups follows from the list.
When the list does not divide evenly the remainder is spread rather than dumped. Asking for pairs from nine people gives four pairs and one three, not four pairs and a lone person, because a group of one is not a group.
The result is plain text you can copy out, which is usually what happens next — into a slide, a whiteboard or a message.
Common questions
How do I split a list into random groups?
Paste the list, choose how many groups you want or how big each should be, and generate. The list is shuffled and dealt out, so the groups end up within one member of each other.
Will the groups be the same size?
As close as the numbers allow. Dealing round-robin means the largest and smallest group never differ by more than one, so nobody ends up alone in a leftover group.
Is the grouping different every time?
Yes. The shuffle is Fisher-Yates seeded from the browser's cryptographic random source, so re-running gives a genuinely independent arrangement.