Random Team & Group Generator

Project teams, lab pairs, classroom groups — paste names, pick a method, shuffle. Optional exclusions keep known troublemakers apart (or best friends together).

—
Embed this tool on your website / blog No code required · Copy and paste
HTML Embed Code (iframe):
<iframe src="https://lucentool.com/random-group-generator" width="100%" height="650" style="border:1px solid #e5e0d8;border-radius:12px;max-width:850px;width:100%;" frameborder="0"></iframe>
<div style="font-size:12px;color:#78716c;margin-top:6px;font-family:sans-serif;">Powered by <a href="https://lucentool.com/random-group-generator" target="_blank" style="color:#c85a32;text-decoration:none;">Lucentool - Random Team & Group Generator</a></div>

Balanced random grouping

The tool shuffles the list and deals members round-robin, so groups stay within ±1 member of each other — no 7-person group next to a 2-person group. With number of groups mode, sizes are as even as the list allows; with members per group, the last group may be smaller.

Exclusions

Each line declares a pair that must not share a group (Alice, Bob). The algorithm retries up to 50 times to place everyone legally; if no valid arrangement exists, it reports the conflict pairs it couldn't avoid. Exclusions only enforce separation; there is no dedicated "keep together" mode. For pairing people, just use groups of 2.

Teacher tips

How the calculation works

shuffle() implements Fisher–Yates: starting from the end, each element swaps with a randomly chosen earlier position, which gives every permutation equal probability. That matters because the naive "sort by random comparator" approach produces a biased distribution. randInt() picks the indices, and after shuffling the list is sliced in order into the number of groups or the group size you asked for.

Where the formula stops applying

The randomness comes from Math.random(), which is fine for splitting a class or picking teams but is not cryptographically secure — for a prize draw with money attached, use a CSPRNG. Results are not reproducible, since there is no seed. Group sizes cannot always be equal: 23 people into four groups gives three groups of six and one of five. Balanced assignment by gender, ability or friendship constraints is a different algorithm.

Privacy: your figures stay in the browser

Names are shuffled in memory on your device; nothing is uploaded and the result disappears when the tab closes.

Frequently asked questions

Can I reproduce the same groups?

No. There is no seed, so each shuffle differs. Export the result if you need a record.

Why are the group sizes uneven?

Because the count does not divide evenly. The remainder is distributed as an extra member in the first groups.

Can it balance groups by gender or skill?

No. This is pure randomisation; constrained assignment needs a different method.