Clever Quest Lab Tools

Random Group Generator

2026-10-06

Paste a list of names, choose how many groups you want or how big each group should be, and get fair random groups in one click. Group sizes always differ by at most one. Copy the result or print it; your list stays in this browser.

1. Your names

Names are never uploaded. The list and your settings are saved only in this browser; "Clear list" removes the saved list.

2. How to split

Split by

3. Your groups

How to use the random group generator

  1. Type or paste your names into the list, one name per line. If you paste a single line with commas, semicolons or tabs between the names, the tool splits it for you. Blank entries are dropped and extra spaces are trimmed.
  2. Choose Number of groups if you know how many groups you need, or People per group if you know how large each group may be.
  3. Enter the number, pick a label (Group, Team or your own text such as Table) and tick the leader box if you want one random leader marked in every group.
  4. Press Generate groups; once groups exist the same button reads Shuffle again. Press it as often as you like; every press is a new, independent shuffle.
  5. Use Copy all groups to paste the result into a message or document, or Print for a clean sheet that contains only the title and the groups.

How the even split works

Let n be the number of names. In "Number of groups" mode you choose the number of groups k directly. In "People per group" mode you choose a size s, and the tool works out the number of groups as the next whole number up:

k = ceil(n ÷ s)
q = floor(n ÷ k)
r = n − q × k

Here ceil rounds up and floor rounds down. Every group gets at least q people, and the r people left over are handed out one each to the first r groups. So r groups have q + 1 people and the other k − r groups have q. Group sizes therefore differ by at most one, nobody is left alone in a small leftover group, and because the people are shuffled first, being in a larger group is a matter of chance. Because the number of groups is rounded up, no group is ever larger than the size you asked for. If the request is impossible (empty list, a number that is not a whole number of at least 1, or more groups than names), the tool explains the problem instead of showing a result.

Examples

Example 1: 10 names, 3 groups. q = floor(10 ÷ 3) = 3 and r = 10 − 3 × 3 = 1, so one group has 4 people and two groups have 3 (sizes 4, 3, 3).

Example 2: 10 names, 4 per group. k = ceil(10 ÷ 4) = 3, which gives the same split as Example 1: 4, 3, 3. Filling groups of four one after another would leave a last group of only two people.

Example 3: 12 names, 4 per group. k = ceil(12 ÷ 4) = 3, q = 4, r = 0: three groups of exactly 4.

Example 4: 25 names, 6 groups. q = floor(25 ÷ 6) = 4 and r = 25 − 4 × 6 = 1: one group of 5 and five groups of 4 (sizes 5, 4, 4, 4, 4, 4).

If you ask for 8 groups from 7 names, there is no valid split, so the tool shows a message asking you to choose 7 groups or fewer.

Using it in a classroom, a team or a workshop

Put the class list on the projector, set the number of groups and press the button in front of everyone. Because the result visibly comes from a shuffle rather than from the teacher, the groups are easier to accept. A few practical habits help:

Why a computer shuffle is fairer than counting off

Counting off ("1, 2, 3, 1, 2, 3") ties group membership to who stands where. Friends who sit together are split in the same way every time, and groups repeat from lesson to lesson as long as seating stays the same. Letting students choose their own groups, or choosing for them, tends to repeat the same cliques and can look like favouritism. A shuffle ignores seating, alphabetical order and history: before the draw, every person has the same chance of ending up in every group.

Ideas for balanced groups

Frequently asked questions

Is it really random?

The order is produced with the Fisher–Yates shuffle: starting from the last position, each item is swapped with an item chosen at random from the positions up to and including it. With unbiased random choices, all possible orders are equally likely. The choices come from crypto.getRandomValues, the random source built into your browser, which is designed for security uses and is fed by your operating system. To avoid a small bias, values that would make some positions slightly more likely are discarded and drawn again (rejection sampling) instead of using a plain remainder. It is computer-generated randomness, not a physical coin, but it is unpredictable for practical purposes. If a browser lacks that source, the tool falls back to the ordinary Math.random function, which is fine for classroom use but not designed for security.

What if the names do not divide evenly?

The leftover people are spread one by one over the first groups, so sizes differ by at most one. For 10 names in 3 groups you get 4, 3 and 3.

What happens to duplicate names?

They are kept, because two real people can share a name. The tool shows how many duplicate entries it found and offers "Remove duplicates", which keeps the first of each name and ignores differences in capital letters.

How many names can I use?

There is no fixed limit. Lists of a few hundred names are handled instantly on an ordinary phone or laptop.

Are my names uploaded or stored anywhere?

No. Shuffling happens in your browser and nothing is sent to a server. The list and your settings are saved in this browser's local storage only, so they are still there when you return. Press "Clear list" to remove the saved list. If storage is blocked or you use a private window, the tool still works but forgets the list when you close the page. Anyone who uses the same browser profile can see the saved list.

Related tools