Clever Quest Lab Tools

Random Group Generator

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
Keep apart / keep together optional

One rule per line: names from your list, separated by commas. A line can hold two or more names.

3. Your groups

Runs on your device. Nothing you type or record is uploaded. Keeps working without a connection while the page is open. Works with touch. Saves your name list, settings and keep-apart/keep-together rules on this device (Clear list removes the list); generated groups are not kept after a reload.

Added · Updated : keep apart and keep together rules for chosen people

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. There is no fixed limit on how many names you enter.
  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. If some people must not share a group, or must share one, open Keep apart / keep together and write one rule per line (see below).
  5. 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.
  6. 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.

The names are shuffled with the same Fisher–Yates shuffle and browser random source as the List Randomizer, which explains why every order is equally likely.

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.

Keeping people apart or together

Open Keep apart / keep together in step 2 and write one rule per line, using names from your list separated by commas. In Keep apart, every name on a line goes to a different group: Person 1, Person 2 never share a group, and a line with three names keeps all three apart. In Keep together, all names on a line go to the same group. A name has to match an entry in the list; capital letters and extra spaces do not matter. A name that appears twice in the list cannot be used in a rule until the two entries differ, because the tool could not tell which person you mean.

With rules set, the tool makes the same draw as without them (shuffle the whole list, then split it into the even sizes above), checks the rules, and draws again until they all hold, up to 5,000 times. Every split that meets the rules is then equally likely, and the group sizes still differ by at most one. When 5,000 draws are not enough, usually because several people must stay together, the tool switches to a step-by-step search that places the linked people first and makes its other choices at random. Its groups are still random, but not every possible split is exactly equally likely. The line above the groups says which of the two found the result.

Some rules cannot be met. Instead of searching forever, the tool says why:

Example 5: rules with the sample names. Load the 12 sample names, choose 3 groups, write Person 1, Person 2, Person 3 under Keep apart and Person 4, Person 5 under Keep together. Every press gives three groups of 4 with Persons 1, 2 and 3 in different groups and Persons 4 and 5 in the same group. Change the number of groups to 2 and the tool explains that the Keep apart line names 3 people but there are only 2 groups.

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

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.