How to Split a Class Into Random Groups Fairly (2026)

How to Split a Class Into Random Groups Fairly (2026)

A random group generator should make the piles, not the pedagogy. FlashKit’s random group generator takes one name per line and a number of groups, shuffles, and deals. It will not keep two students apart, will not balance talkative vs quiet, and will not remember last Tuesday’s teams. Those constraints are a manual pass after the shuffle — described below, not hidden behind a fake “smart groups” toggle. Sports and quiz-night sizes are in the random team generator guide; to count votes with a tally counter, open TickCounter.

Uneven division math (29 students into groups of 4)

You want groups of about four. The tool does not take a group size. Convert: 29 ÷ 4 = 7.25, so you choose 7 groups or 8 groups.

The deal is round-robin after a Fisher–Yates shuffle. Index i goes to group i % groupCount. Remainder names land in the first groups. Verified by running that deal (order does not matter for sizes):

  • 29 names, 7 groups: sizes 5, 4, 4, 4, 4, 4, 4. Check: 5 + 24 = 29. One group of five, six of four.
  • 29 names, 8 groups: sizes 4, 4, 4, 4, 4, 3, 3, 3. Check: 20 + 9 = 29. Five groups of four, three of three.

Sizes differ by at most one. That is the fairness the shuffle can guarantee. It will not give you seven groups of four and dump the extra person — that would be 28, not 29. If you truly need every group ≤ 4, you must enter 8 groups and accept three triples.

Smaller checks: 8 default sample names into 4 groups → 2, 2, 2, 2. 10 names into 3 groups → 4, 3, 3. 1 name and 1 group → one singleton. More groups than names is rejected.

Shuffle names into N groups

One name per line, number of groups, Fisher–Yates then round-robin. No keep-apart field.

Open the random group generator

Constraints the tool does not have

Teachers usually want at least one of: A and B must not sit together; each table needs a “strong” reader; last week’s partners should not repeat; mixed language pairs. FlashKit has none of those inputs. Do this by hand:

  • Keep-apart pairs. Generate. If A and B landed together, swap B with anyone in another group. One swap preserves sizes. Two overlapping constraints may need a second swap; if it still fails, re-roll.
  • Skill bands. Pre-sort the paste into High / Mid / Low blocks (or tag names Aisha H, Ben L). Shuffle inside each band on paper, then zip: H, M, L, H, M, L into the generator so round-robin sprinkles bands. Or generate freely and swap until each group has one H. The generator will not read the tags.
  • No-repeat history. There is no memory and no seed field. Keep last week’s screenshot. After a new roll, swap anyone who is re-paired. A spreadsheet of past pairs is the thorough version; this page will not grow one.

Fisher–Yates here uses Math.random() for the index. That is an unbiased shuffle for a classroom, not a cryptographic draw. Do not use it to pick a raffle winner that must survive an audit. For a single name from a list, the random picker animates one winner; it is not a grouping tool and it also uses Math.random().

Teacher workflow

  1. Export the roster from the gradebook as a column of names. Paste. Trim extra header rows — blank lines are dropped, but “Name” as a row becomes a fake student.
  2. Decide N from headcount / target size, using the 29-into-7-or-8 example. Type N. Generate.
  3. Read the groups aloud or project the page. Swap for constraints. Do not re-roll for a “better vibe” after students have seen names — that is how fairness complaints start. If you must re-roll, do it before you show the board.
  4. Copy the lists into the lesson slide. The tool does not save them; a refresh restores the eight-name sample (Alice…Heidi).

Lab groups that need even equipment (one soldering iron per table) are a size constraint, not a random constraint: pick N from the equipment count first, then shuffle. Sports mixed-ability sides are the skill-band zip. Seating charts that must respect a safeguarding pair-apart are the swap-after-roll path; put that pair in the notes, not in a web form that cannot enforce it.

The default sample is Alice, Bob, Charlie, Dana, Eve, Frank, Grace, Heidi and 4 groups — two names each after a shuffle. Eight names into 3 groups is sizes 3, 3, 2. Duplicate a name on two lines and that person gets two seats; the tool does not de-duplicate. A trailing space on “Ada ” is trimmed; an empty line is dropped. Number of Groups 0, empty, or text is rejected. Refreshing the tab restores the sample and forgets the cards — screenshot before you walk to the board. The shuffle is unbiased in the Fisher–Yates sense: every permutation of the trimmed list is equally likely under a uniform Math.random(). It is not a recorded draw. If a parent asks how the groups were chosen, the honest answer is “browser shuffle, then I swapped A and B so they are not together,” not “the website balanced skills.”

Hackathon tables, lunch teams, and standup breakouts use the same math. Pick N from the room count (tables, mentors, whiteboards), paste the roster, generate, then apply the one constraint you actually have. There is no export CSV. Copy the lists. For a single volunteer instead of teams, the random picker is the sibling: one winner, sampling with replacement unless you delete the line.

Worked 29-into-7 again so the board math is boring. Remainder 29 − 7×4 = 1, so exactly one group is 5. The extra name always lands in Group 1 because round-robin starts at index 0. If you wanted the large group to be Group 7, that is a post-shuffle rotate the tool will not do. 29-into-8: remainder 29 − 8×3 = 5, so five groups of 4 and three of 3, extras in Groups 1–5. Teachers who insist on “groups of four” with 29 people must either sit the extra student as a fifth in one group (N=7) or accept triples (N=8). There is no N that yields seven uniform fours. That is integer division, not a fairness complaint about Math.random.

Team generator for class, group randomizer, random groups — same widget. It will not keep last week’s partners apart, will not put one “strong” reader at every table, and will not avoid a safeguarding pair. Those are swaps after the roll, written on the board, owned by the teacher. Re-rolling after students have seen names is how you get “the website cheated.” Generate once, swap the constraints, screenshot, teach. The random picker is for one name; this page is for N piles.

Fair, here, means sizes differ by at most one and the shuffle is unbiased. It does not mean educationally optimal. A constraint solver (ILP, greedy keep-apart) is a different program. FlashKit will not become one in this article. If you need that, pre-sort skill bands, generate, then swap. The 29-student example is the whole arithmetic lesson. Uneven numbers are normal; pretending 29 divides by 4 is the actual unfairness.

Pick one name instead

Random picker: one winner from a list. Same shuffle family, not groups.

Open the random picker

Related Tools