The short answer

Number of groups = class size ÷ group size, rounded down; the leftover students join existing groups. 26 students in groups of 4 gives 6 groups: four of 4 and two of 5. If you’d rather keep groups small, choose “put extras in a smaller group” and you get six groups of 4 plus one pair. The order is shuffled with an unbiased Fisher–Yates shuffle, so every arrangement is equally likely — and the names you type stay on your device.

Choosing groups by hand takes time and invites the question every teacher knows: “Why am I always with them?” A random generator answers it for you — the computer picked, and it picked fairly. This one also handles the awkward parts: uneven numbers, students who shouldn’t work together, and getting everyone to look at the same screen.

How the groups are made

The tool shuffles the whole list, then cuts it into groups of the sizes you asked for. There are two ways to set the size:

  • Students per group. Number of groups = class size ÷ group size, rounded down. With 26 students in groups of 4, that’s 6 groups.
  • Number of groups. The class is split as evenly as possible: each group gets class size ÷ groups (rounded down), and the remainder adds one extra student to the first few groups. 26 students in 5 groups gives 6, 5, 5, 5, 5 — sizes never differ by more than one.

The shuffle is the Fisher–Yates algorithm driven by your browser’s cryptographic random generator, with a correction that removes the small bias a naive “random number modulo n” would add. In plain terms: every possible order of your class is equally likely, so no seat on the list is lucky or unlucky.

When the numbers don’t divide evenly

Here is what each leftover setting does with groups of 4:

Class sizeBalance (extras join groups)Smaller group for extras
223 groups of 4 + 2 groups of 55 groups of 4 + 1 of 2
232 groups of 4 + 3 groups of 55 groups of 4 + 1 of 3
255 groups of 4 + 1 group of 56 groups of 4 + 1 of 1
264 groups of 4 + 2 groups of 56 groups of 4 + 1 of 2
273 groups of 4 + 3 groups of 56 groups of 4 + 1 of 3
305 groups of 4 + 2 groups of 57 groups of 4 + 1 of 2

Balance is usually the better default: a group of one isn’t a group. “Smaller group” makes sense when the task needs a fixed size — four roles, four stations — and you plan to join the leftover pair to another group yourself or work with them directly.

How many groups will a class of 20 to 32 make?

Most teachers think in group sizes (“groups of 3”), so the quickest way to plan is to know what the classroom group maker will return before you press Shuffle. The table uses Students per group with the default Balance setting: number of groups = class size ÷ group size, rounded down, then leftover students are spread one at a time across groups.

Balanced splits by class size and chosen group size (Students per group mode)

Class sizeGroups of 2Groups of 3Groups of 4Groups of 5
2010 of 24 of 3 + 2 of 45 of 44 of 5
2412 of 28 of 36 of 44 of 6
2511 of 2 + 1 of 37 of 3 + 1 of 45 of 4 + 1 of 55 of 5
2814 of 28 of 3 + 1 of 47 of 42 of 5 + 3 of 6
3015 of 210 of 35 of 4 + 2 of 56 of 5
3216 of 28 of 3 + 2 of 48 of 44 of 5 + 2 of 6

Notice the groups-of-5 column: 24 students ÷ 5 rounds down to 4 groups, and the 4 leftover students turn every group into a 6. When that happens, switch to Number of groups and type 5 instead. You get 5, 5, 5, 5, 4, which is closer to what you meant.

After the groups are set, a few routines help: pick a student at random to report for each group, place the groups with the seating chart maker, and browse the other classroom management tools for timers and grading.

Keep-apart pairs without losing fairness

Some pairs simply don’t work: best friends who chat, two students in a conflict, or two strong readers you want spread across groups. Type each pair on a line, like Ava, Ben.

The tool doesn’t swap names around afterward, because that would quietly make some outcomes more likely than others. Instead it reshuffles until no pair shares a group and keeps the first arrangement that passes. Every valid arrangement is still equally likely.

How often does a pair land together by chance? With 24 students in 6 groups of 4, once Ava is placed, 3 of the remaining 23 spots are in her group, so the chance Ben joins her is 3 ÷ 23 ≈ 13%. A rule for a few pairs rarely needs more than a handful of reshuffles. If your rules can’t all be met (too many pairs for too few groups), the result line says how many pairs are still together.

Roles that keep groups working

Tick Assign roles and each group gets roles in the order you list them — by default Leader, Recorder, Timekeeper and Reporter. Because each group’s members are already in random order, the roles land randomly too. Groups larger than the role list get plain members; smaller groups skip the last roles, so put the most important role first.

A short role card on the board helps:

  • Leader — keeps everyone on the task and makes sure each person speaks.
  • Recorder — writes down the group’s answers or notes.
  • Timekeeper — watches the clock; pair this with the classroom timer on the board.
  • Reporter — shares the group’s answer with the class.

Rotating roles each time you regroup gives quieter students a turn at Leader and Reporter without you having to assign it publicly.

Showing groups to the class

Press Full screen and the group cards expand for the projector, each with its own colored top bar so students can find “the green group” quickly. Re-shuffle works in full screen as well.

When you need a record, Copy groups puts plain text on the clipboard (one line per group, ready to paste into your LMS or an email to a co-teacher), Download CSV gives a spreadsheet with group, name and role, and Print groups prints just the cards. Nothing about the groups is added to the page address, so a shared link only carries settings like the group size — never names.

Make movement fast Before showing the groups, assign each group a spot in the room (group 1 by the window, group 2 at the back table…). Show the cards, start a 2-minute timer, and have groups seated and named before it ends.

Classroom tips for random groups

  • Say why it’s random. “The computer picks so it’s fair for everyone” ends most complaints before they start.
  • Regroup on a rhythm. New groups for each unit, or every couple of weeks, gives students a chance to work with most of the class.
  • Mix random with purpose. Use keep-apart pairs to spread support, then let chance do the rest. If you need fully hand-built groups, random groups are still a useful first draft to adjust.
  • Save each period. Save your lists as “Period 1”, “Period 2” and so on. The same lists appear in the random name picker for cold-calling and the seating chart maker for desks.
  • Pair group work with clear scoring. A simple rubric tells groups what a strong result looks like before they begin.

Frequently asked questions

Is the random group generator really random?
Yes. The list is shuffled with the Fisher–Yates algorithm using your browser’s cryptographic random number generator (crypto.getRandomValues), with rejection sampling so no position is favored. Every ordering of the class is equally likely, and the groups are cut from that ordering.
How do I keep two students out of the same group?
Open “Keep-apart pairs” and type each pair on its own line, separated by a comma (for example: Ava, Ben). The tool reshuffles until no pair shares a group. If that is impossible (say, two groups and three students who must all be apart), it shows the best arrangement it found and tells you how many pairs it couldn’t separate.
What happens when the class doesn't divide evenly?
You choose. “Balance” adds the extra students to other groups, so sizes differ by at most one when you set the number of groups. “Put extras in a smaller group” keeps every group at your chosen size and puts the remainder together in the last group.
Are my students' names saved or uploaded?
Names are never uploaded and never added to the page address. If you press Save list, the class is stored in your browser’s local storage on this device only, so you can reuse it here, in the random name picker and in the seating chart maker. Clearing your browser data deletes it.
Can I show the groups on the projector?
Yes. Press Full screen above the group cards and the random groups grow to fill the projector screen, each card with its own colored top bar so students can find their group quickly. The Re-shuffle button stays available in full screen. Press Escape or Exit full screen to return to the settings and the class list.
Can I make groups without typing names?
Yes. Leave the name box empty and enter the number of students instead. The random group generator then shows groups as numbers (#1, #2 and so on), which works well if students count off or already have class numbers. Group size, leftover handling and roles work the same way as with a typed list of names.
How do I make groups of 3 from 28 students?
Set the random group generator to 3 students per group with 28 students. 28 divided by 3 is 9 with 1 left over, so Balance gives 9 groups: eight groups of 3 and one group of 4. If you choose to put extras in a smaller group, you get nine groups of 3 plus a group of 1, which is why Balance is the better default here.
Can I generate balanced groups?
The random group generator balances group sizes, so groups never differ by more than one student when you choose Balance. It does not rank students by ability, because it only knows names. To spread strong readers, helpers or friends across groups, list them as keep-apart pairs; the tool then reshuffles until no listed pair shares a group, and every valid arrangement stays equally likely.
Can I save groups for later?
The class list can be saved on your device with Save list, but each set of groups is a fresh shuffle. To keep a particular set, press Copy groups to paste them into your LMS or an email, Download CSV for a spreadsheet with group, name and role, or Print groups for a paper copy. Pressing Re-shuffle replaces the groups on screen.

Sources & method

  • Shuffle: Fisher–Yates (Durstenfeld) algorithm — R. Durstenfeld, “Algorithm 235: Random permutation”, Communications of the ACM, 1964; also described by D. Knuth, The Art of Computer Programming, Vol. 2.
  • Randomness: MDN — Crypto.getRandomValues() (“cryptographically strong random values”).
  • Group sizes and probabilities on this page are computed directly; no survey data is used.

Formulas checked October 2026. Spotted an error? Tell us via the about page.

Add this tool to your class website

Free for teachers, schools and PTAs. The embed is accessible (keyboard and screen-reader friendly), has no ads and no tracking. Paste this code into your page:

More tools you can embed: the embed directory.