Random Group Generator Widget
Help teachers and organisers make random teams in seconds. Paste the names, choose how many groups or how many people per group, and the widget shuffles fairly and deals everyone out so group sizes never differ by more than one.
Live preview
Under the widget on your page: Powered by A2Z Tools
Embed code
<iframe src="https://a2z.tools/embed/w/group-generator" title="Random Group Generator by A2Z Tools" width="100%" height="600" style="border:0;width:100%" loading="lazy" allow="clipboard-write"></iframe>
A plain iframe. Works everywhere, including site builders that strip scripts. Adjust height if your content needs more room.
<div data-a2z-widget="group-generator" data-height="600"></div> <script async src="https://a2z.tools/embed.js"></script>
Adds a small script (what it does) that sizes the widget to fit its content, loads it lazily and keeps it isolated from your page's CSS.
Works with
How it works
The names are shuffled with the Fisher-Yates algorithm, using the browser's cryptographic random generator with rejection sampling for each swap, which makes every possible ordering of the class equally likely. The shuffled list is then dealt round-robin, like cards, into k groups. In 'number of groups' mode k is the number chosen; in 'people per group' mode k = ceil(names / size), so 10 students in groups of 4 become groups of 4, 3 and 3 rather than 4, 4 and a lonely 2. Dealing round-robin guarantees the largest and smallest groups differ by at most one. Asking for more groups than names, or a group size that would put everyone together, gives a plain message. Copy groups produces one line per group, ready to paste into a chat or a slide. Press Make groups again for a fresh shuffle.
Method
- Shuffle: for i = n - 1 down to 1, swap item i with a uniformly random item 0..i
- Groups k = N (number mode) or ceil(n / N) (size mode)
- Name at shuffled position j goes to group (j mod k) + 1
Worked examples
Groups of at most four
Inputs: 10 names, people per group = 4
Result: 3 groups of 4, 3 and 3
ceil(10 / 4) = 3 groups, dealt round-robin.
A fixed number of tables
Inputs: 12 names, number of groups = 5
Result: Groups of 3, 3, 2, 2 and 2
12 = 5 x 2 + 2, so the first two groups get one extra person.
Limitations
- No skill balancing, gender balancing or keep-apart rules - the split is purely random.
- Groups are not saved; making new groups discards the previous ones.
- Duplicate names are treated as different people.
Where publishers use it
- Classroom project teams and lab partners
- Workshop and training-day breakout rooms
- Sports clubs splitting players into sides
- Hackathon and event organisers forming tables
- Online course forums assigning peer-review circles
Questions
Why are my groups 4, 3 and 3 instead of 4, 4 and 2?
The size you enter is treated as a maximum and the groups are balanced: 10 names need ceil(10 / 4) = 3 groups, and dealing evenly gives 4, 3 and 3.
How is fairness guaranteed?
A Fisher-Yates shuffle driven by the cryptographic random generator makes every ordering equally likely; for 3 names, each of the 6 orders turns up about one time in six.
Can I keep certain students apart?
Not automatically. Shuffle again until you are happy, or adjust by hand after copying the groups.
How many names can it handle?
Up to 1,000 names, each up to 80 characters. Blank lines and extra spaces are ignored.
Can I preload the list and the split?
Yes: v_names=A|B|C|D|E|F&v_mode=size&v_n=2 starts with six names in pairs.
What classroom activities use random groups?
Jigsaw reading, where each group becomes expert in one section and then teaches it; think-pair-share, which needs pairs (choose people per group = 2); and rotating lab benches each week so students mix beyond their usual friends. A fresh shuffle each lesson gives new combinations.
Cite or recommend this tool
If you reference this tool in an article, course or documentation, these formats are ready to copy. They are optional - nothing is added to your site unless you paste it.
A2Z Tools Random Group Generator https://a2z.tools/embed/group-generator
<a href="https://a2z.tools/embed/group-generator">A2Z Tools Random Group Generator</a>
[A2Z Tools Random Group Generator](https://a2z.tools/embed/group-generator)
Random Group Generator by A2Z Tools - https://a2z.tools/embed/group-generator
Related widgets
-
Fairly pick a student, winner or volunteer from a list, with history and an option to remove each pick.
-
Fair random numbers in any range - whole or decimal, with or without repeats, sorted if you like.
-
Attendance percentage, classes to attend to reach 75%, or how many lectures you can still skip.
-
X% of Y, X as a percent of Y, and the percentage change between two values.
-
A clean on-screen calculator with keyboard support, correct operator precedence and percent.
-
Trig in degrees or radians, logs, roots, powers, factorials, pi, e and Ans - typed or tapped.