Balanced Classroom Group Generator — Not Random
Splits a class into groups that are fair on every trait you list — gender, reading level, language — keeps chosen students apart or together, and shows the balance it achieved. A real optimizer, not a shuffle.
Built for classroom groups; it works the same way for work teams. Free, no sign-up, and your list is not stored.
How to set up your file
One tab lists your people. The tool reads that layout, not an arbitrary spreadsheet, so start from the sample and replace its rows.
must be together and must be apart.priority, then a number for each trait: 1 is the most important. Each step down counts four times less, ties are allowed, and a blank means lowest.must be together) or always in different groups (must be apart). Codes can be numbers or words (1, 2, A, B), and a student can hold several, separated by commas.An optional settings tab can hold groups, min size and max size so the file remembers its own setup. Here is the start of the sample's people tab (30 students in all):
| student | must be together | must be apart | gender | reading level | math score | first language | club |
|---|---|---|---|---|---|---|---|
| priority | 1 | 2 | 2 | 3 | |||
| Ava | 1 | female | 4 | 43 | Spanish | chess | |
| Liam | male | 5 | 80 | English | art | ||
| Sofia | 1 | female | 4 | 48 | English | art | |
| Noah | A | male | 4 | 67 | Arabic | band | |
| Mia | 1 | female | 5 | English | chess | ||
| Lucas | male | 3 | 70 | Spanish | soccer |
A worked example: the sample class in 6 groups
This is the result for the sample above (30 students, 6 groups), exactly as the tool returns it. Ava, Sofia and Mia share a must be together code and so sit in one group; Noah, Ethan and Leo share a must be apart code and land in three different groups. Gender has priority 1, reading level and math score priority 2, first language priority 3, and club none, so the tool trades a little of the lower-priority columns before it gives up any of the higher ones.
30 people in 6 groups of 5 people. Proven within 5% of the best possible grouping.
The groups
| Group | Size | Members |
|---|---|---|
| 1 | 5 | Ava, Sofia, Mia, Jonas, Theo |
| 2 | 5 | Liam, Chloe, Hugo, Aria, Marco |
| 3 | 5 | Noah, Emma, Isla, Diego, Felix |
| 4 | 5 | Lucas, Zoe, Leo, Ravi, Yara |
| 5 | 5 | Ethan, Mateo, Nora, Ruby, Tess |
| 6 | 5 | Omar, Kai, Lena, Priya, Nina |
How balanced it is
| Trait | Balanced as | Priority | Balance score | Largest gap between a group and the class |
|---|---|---|---|---|
| gender | categories (proportional mix) | 1 | 80.0 | 0.5 (largest gap between a category's count in a group and its fair (proportional) count) |
| reading level | numbers (equal averages) | 2 | 89.6 | 0.3667 (largest gap between a group average and the overall average) |
| math score | numbers (equal averages) | 2 | 71.7 | 10.4074 (largest gap between a group average and the overall average) |
| first language | categories (proportional mix) | 3 | 64.5 | 1.5 (largest gap between a category's count in a group and its fair (proportional) count) |
| club | categories (proportional mix) | lowest | 76.0 | 1.28 (largest gap between a category's count in a group and its fair (proportional) count) |
Balance score: 100 means every group mirrors the whole class exactly on that trait; 0 is the worst arrangement possible. Whole students can't be split, so 100 is often out of reach.
gender: each group against the class
| Group | People counted | female | male |
|---|---|---|---|
| 1 | 5 | 3 | 2 |
| 2 | 5 | 2 | 3 |
| 3 | 5 | 2 | 3 |
| 4 | 5 | 2 | 3 |
| 5 | 5 | 3 | 2 |
| 6 | 5 | 3 | 2 |
| Overall | 30 | 15 (50%) | 15 (50%) |
reading level: each group against the class
| Group | People counted | Average |
|---|---|---|
| 1 | 5 | 3.4 |
| 2 | 5 | 2.8 |
| 3 | 5 | 3.0 |
| 4 | 5 | 3.0 |
| 5 | 5 | 3.0 |
| 6 | 5 | 3.0 |
| Overall | 30 | 3.0333 |
math score: each group against the class
| Group | People counted | Average |
|---|---|---|
| 1 | 4 | 60.0 |
| 2 | 5 | 73.0 |
| 3 | 4 | 71.25 |
| 4 | 5 | 71.0 |
| 5 | 4 | 72.0 |
| 6 | 5 | 73.6 |
| Overall | 27 | 70.4074 |
first language: each group against the class
| Group | People counted | Spanish | English | Arabic | Mandarin |
|---|---|---|---|---|---|
| 1 | 5 | 1 | 2 | 0 | 2 |
| 2 | 5 | 2 | 3 | 0 | 0 |
| 3 | 5 | 2 | 2 | 1 | 0 |
| 4 | 5 | 1 | 3 | 0 | 1 |
| 5 | 5 | 1 | 2 | 2 | 0 |
| 6 | 5 | 1 | 2 | 0 | 2 |
| Overall | 30 | 8 (27%) | 14 (47%) | 3 (10%) | 5 (17%) |
club: each group against the class
| Group | People counted | chess | art | band | soccer |
|---|---|---|---|---|---|
| 1 | 5 | 2 | 1 | 1 | 1 |
| 2 | 4 | 1 | 1 | 1 | 1 |
| 3 | 3 | 1 | 1 | 1 | 0 |
| 4 | 5 | 2 | 1 | 1 | 1 |
| 5 | 3 | 0 | 0 | 2 | 1 |
| 6 | 5 | 3 | 1 | 0 | 1 |
| Overall | 25 | 9 (36%) | 5 (20%) | 6 (24%) | 5 (20%) |
How it's different from a random group generator
- It measures. A random generator gives you a list and no way to judge it. Here every trait gets a balance score and a per-group table, so you can see where the groups are even and where they are not.
- It optimizes. A mixed-integer solver searches for the arrangement closest to the class's own mix on every trait, weighting the traits by your priorities. A shuffle only gets that by luck, and the larger and more varied the class, the less likely luck is.
- Rules are hard rules. Students you keep apart are never together, and students you keep together never split. A shuffle needs you to re-draw until it happens to work.
- Sizes stay even. With a group count, no group is more than one student bigger than another.
- It says what it can't do. If your rules cannot all hold at once, or whole students can't hit a perfect mix, you get a plain message or a score below 100, not a silent compromise.
What it does not do: seating charts, tournament brackets, or rotating groups over several weeks.
Use it where you work
Google Sheets add-on: make the groups without leaving your class spreadsheet. MCP server: ask Claude or ChatGPT to make the groups and have this solver do the work.
FAQ
Is this really different from a random group generator?
Yes. A random generator shuffles names and hopes. This tool treats the grouping as an optimization problem: it searches for the arrangement where every group's mix of each trait you listed is as close as possible to the whole class's mix, and then shows you the numbers so you can check. Rules such as "keep these two apart" are never broken, which a shuffle cannot promise.
What can I balance?
Any column you add: gender, reading level, a test score, first language, a behaviour rating, a club. Text columns are spread across the groups in proportion to how common each value is. A column where every filled cell is a number is balanced by group average. You can list up to 15 columns, 300 people and 60 groups.
What if two things conflict, such as reading level and language?
The priority row decides. Priority 1 is the most important; each step down counts four times less, so the tool gives up a little of a lower-priority column before it gives up any of a higher one. Ties are allowed, and a blank priority means lowest.
How do I keep two students together, or apart?
Use the "must be together" and "must be apart" columns. Students who share a code are always in the same group (together) or always in different groups (apart). Codes can be numbers or words, and a student can have several, separated by commas. These are rules, not preferences.
Can the groups have different sizes?
Give a number of groups and the sizes differ by at most one student (30 students in 6 groups is 5 each; 31 is five groups of 5 and one of 6). Or give a minimum and/or maximum size and the tool tries every group count that fits and keeps the best balanced one.
What if it says the groups can't be perfectly balanced?
Whole students cannot be split: five students can never be 40 percent of anything. The balance table shows how close the groups got on each trait, from 100 (every group mirrors the class exactly) toward 0 (the worst possible arrangement). Often 100 is not reachable and the optimizer's answer is the closest there is.
Does it keep my student list?
No. The file is read, solved and discarded; the result you download is built in the request and not stored. See the privacy policy. You do not need real names: first names or initials work.
Does it make seating charts, brackets or round-robin schedules?
No. It splits a list into groups. It does not lay out seats, build tournament brackets, or rotate groups over several weeks.
Is it free?
Yes, with no sign-up. It runs a real optimization solver on a small server, so it solves one problem at a time and rate-limits heavy use.
Kind of Lost