Random Group Generator
Split a list of names into fair random groups in one click: choose the number of groups or people per group, balance boys and girls across teams, and pick a leader for each. Copy the result or share it as a link. Free, no sign-up, and your list never leaves your browser.
- Set groups or group size
- Balance boys and girls
- Auto-pick leaders
- Share results by link
Add a tag in brackets after each name, e.g. “Alice (F)”, “Bob (M)”. Each tag’s count per group differs by at most one; people without a tag are spread evenly too.
Put * before a leader’s name, e.g. “*Alice”. Assigned leaders go to different groups; groups without one get a random leader.
Your groups
Click a group name to rename it; copied text and share links use the new names.
🔒 Everything is calculated in your browser. No data is sent to any server.
When to use it
- Classroom groups: paste your class roster, split it into 6 groups and turn on tag balancing so every group gets a similar mix of boys and girls. No more drawing names from a hat.
- Team building and icebreakers: paste the sign-up list, use “People per group” to make teams of 5, then post the share link in Slack, Teams or WhatsApp.
- Pick-up games and PE class: split whoever shows up into 2 or 3 teams with at most one player difference. Tag your strongest players the same way and they spread evenly across teams.
- Study groups and project teams: pick a random leader for every group, or mark leaders with a * in front of their names so each one ends up in a different group.
How to use
- Paste everyone into the list, separated by new lines, commas or spaces. Click “Tidy up” to put one name per line.
- Choose “Number of groups” or “People per group” and enter a number; the group sizes are previewed right below.
- If needed, tick “Balance tags (e.g. boys/girls)” and add a tag in brackets after each name, or choose how leaders are picked under “Leader”.
- Click “👥 Make groups” to see each group on a card. Click a group name to rename it, or click “Shuffle again” for a new draw.
- Click “Copy result” to paste it into a chat, or “Copy share link” so everyone opens the same groups.
Worked example
23 people with 4 per group: 23 ÷ 4 = 5 groups with 3 left over. The 3 extra people join 3 of the groups, giving 3 groups of 5 and 2 groups of 4 — never a leftover group of 3. Asking for 6 groups instead gives 5 groups of 4 and 1 group of 3.
30 students (16 boys, 14 girls) in 6 groups with tag balancing on: every group has 5 people. Boys: 16 ÷ 6 = 2 remainder 4, so 4 groups get 3 boys and 2 groups get 2. Girls: 14 ÷ 6 = 2 remainder 2, and the extra girls go to the two groups with only 2 boys. The actual result was 4 groups of “M 3 · F 2” and 2 groups of “M 2 · F 3”.
12 people in 5 groups, with Alice, Bob, Carol and Dave marked as leaders (*Alice and so on): the groups have 3, 3, 2, 2 and 2 people, the 4 leaders all land in different groups, and the one group without an assigned leader gets a randomly picked one.
The list “Alex, Sam, Alex, Jo” has two people called Alex, so they become “Alex#1, Sam, Alex#2, Jo”. Both are kept and numbered, so you can still tell them apart in the result.
Reading the results
- The preview under the settings (for example “23 people → 5 groups: 3 × 5 people, 2 × 4 people”) shows exactly how big each group will be, so you can check before you click.
- Which groups get the extra person is also random — it is not always Group 1. The leader is always listed first in each group with a “Leader” badge.
- Every click on “Shuffle again” is a fresh draw that ignores the previous one. With 4 people in 2 groups, any two people end up together with probability 1/3, so landing together twice in a row is not unusual.
- With tag balancing on, each card shows that group’s tag counts (for example “M 3 · F 2”) so you can see the balance at a glance. People without a tag count as “No tag” and are spread evenly too.
How it works
- Randomness: the browser’s crypto.getRandomValues (a cryptographically secure generator), with rejection sampling to avoid modulo bias — the same method as our Random Name Picker.
- Number of groups: used as-is when you set it. When you set s people per group, the number of groups is floor(people ÷ s) and the leftovers are added one per group. Splitting n people into k groups gives n mod k groups of floor(n ÷ k) + 1 and the rest of floor(n ÷ k), so sizes differ by at most one.
- Shuffling: the list is shuffled with the Fisher–Yates algorithm (from the last item backwards, swap each with a random earlier position), so every order is equally likely. People are then placed into the group slots in that order, and finally the group order itself is shuffled.
- Tag balancing: a tag with c people gives floor(c ÷ k) to every group and one extra to c mod k groups. Choosing which groups get the extras — while keeping total sizes within one and assigned leaders in different groups — is solved as a maximum-flow problem from tags to groups using Dinic’s algorithm.
- Duplicate names: identical names are all kept and numbered #1, #2… in order of appearance; if a numbered name clashes with another name on the list, the next number is used.
Limitations
- Tags must match exactly: “M”, “Male” and “boy” count as three different tags, so use one spelling. Each person can have only one tag, so you cannot balance two things at once (such as gender and grade).
- It does not remember past groupings, so it cannot guarantee new teammates each time, and you cannot require two people to be together or apart.
- A share link is a snapshot of the current result and contains every name, so anyone with the link can see them. Very long lists make long links, which some messaging apps may cut off.
- Results are not saved automatically and disappear when you reload the page. Copy the result or create a share link if you need to keep it.
FAQ
Are the groups really random and fair?
Yes. It uses the browser’s cryptographically secure random numbers (crypto.getRandomValues) and a Fisher–Yates shuffle, so without tags or assigned leaders every possible grouping is equally likely. Nobody can predict or rig the result.
What happens when the numbers don’t divide evenly?
Group sizes never differ by more than one. With “People per group”, leftover people are added to existing groups instead of forming a tiny extra group — 10 people with 4 per group become 2 groups of 5.
What if two people have the same name?
Both are kept and numbered #1 and #2 in the order they appear, and a note appears under the list. If it is the same person entered twice, delete the extra one.
Is my list uploaded or stored?
No. Everything runs in your browser and disappears when you close or reload the page. A share link keeps the result after the # in the URL, which is never sent to a server, so only people you give the link to can see it.
How do I make teams with an even mix of boys and girls?
Tick “Balance tags (e.g. boys/girls)” and add the gender in brackets after each name, such as “Alice (F)” or “Bob (M)”. Each group’s boy and girl counts will differ by at most one, and every card shows the breakdown.
Can I choose who leads each group?
Yes. Under “Leader”, pick “Assign leaders (* before name)” and write leaders as “*Alice” in the list. Assigned leaders always go to different groups, so you can have up to one per group; groups without one get a random leader.
Can I show the groups on a projector or send them to the class?
Yes. “Copy result” gives plain text with one group per line, ready for an email, chat or LMS post. “Copy share link” lets everyone open the exact same groups, which also works well on a classroom screen.
💬 Can't find an answer? Report a problem with this tool or send a suggestion
References
- Crypto: getRandomValues() method — MDN Web Docs
- Fisher–Yates shuffle — Wikipedia
- Maximum flow problem — Wikipedia