Skip to content

Random Assignment Generator

List your participants — or just say how many — name the conditions, and get a randomization list by simple, permuted-block or stratified block randomization. Every list is drawn from a seed you can record, so the same seed and inputs reproduce it exactly for an audit or a methods section. Free, no sign-up, and generated entirely in your browser.

Participants

IDs run P001, P002, … in enrollment order.

List a condition twice for a 2:1 ratio (Treatment, Treatment, Control).

Method

Every block contains each condition equally often, so group sizes can never differ by more than half a block.

A multiple of the 2 listed conditions. Give several sizes (4, 6) and each block's size is drawn at random, which makes the sequence harder to predict.

The same seed with the same inputs always reproduces the same list — record it in your protocol.

Allocation

Set up the participants and conditions, then generate the allocation.

Keep the list concealed

Whoever enrolls participants should not be able to see or predict the next assignment. Generate the list in advance, keep it with someone not involved in recruitment, and reveal each assignment only after that participant is enrolled — for example with sequentially numbered, opaque, sealed envelopes or a central randomization service.

How to Use the Random Assignment Generator

  1. 1. Add the participants. Enter how many there are (IDs P001, P002, …) or paste a list in enrollment order. For stratified randomization, put each participant's stratum after a comma or tab.
  2. 2. Name the conditions. One per line. List a condition twice for a 2:1 allocation.
  3. 3. Choose the method and block size. Permuted blocks are the usual choice. The block size must be a multiple of the number of listed conditions, and giving several sizes (4, 6) makes the sequence harder to guess.
  4. 4. Generate. Leave the seed blank and one is created from your browser's cryptographic random number generator; type an earlier seed to reproduce its list.
  5. 5. Record and export. Copy the seed line into your protocol, check the group sizes, and copy or download the list.

Simple, Block and Stratified Randomization

MethodHow it worksTrade-off
SimpleEach participant gets a condition independently, with equal probability.Completely unpredictable, but groups can end up unequal in small samples.
Permuted blocksEach block of, say, four holds every condition equally often, in random order.Group sizes never differ by more than half a block, but someone who knows the block size can guess the last assignment in each block.
Stratified blocksA separate block list within each stratum, such as site, sex or severity.Balances the groups on the stratifying variable too. Keep strata few, or many blocks are left half-filled.

This is a research allocation tool: the order of enrollment matters and the list has to be reproducible. To split a class into project teams, the Random Group Generator is the simpler choice.

Worked Example: Twelve Participants, Two Conditions

Set the number of participants to 12, keep Control and Treatment, choose permuted blocks of 4, type the seed pilot-01 and generate. The list comes out like this:

BlockParticipantsConditions in order
1P001–P004Control, Treatment, Treatment, Control
2P005–P008Treatment, Control, Control, Treatment
3P009–P012Treatment, Treatment, Control, Control

That gives six in each group. Switch the method to Simple with the same seed and the list becomes 9 Control and 3 Treatment — every assignment a fair coin toss, and still lopsided, which is why studies with a few dozen participants usually block. Type pilot-01 again next month, on any device, and the same lists come back; change any input — the count, the condition names or their order, the block size — and the list changes too.

How the Seed Makes a List Reproducible

The seed text is hashed with cyrb128 into four 32-bit numbers, which start sfc32, a small, fast pseudorandom generator from Chris Doty-Humphrey's PractRand test suite. Conditions are drawn as unbiased whole numbers — a draw that would favor some values is rejected and redrawn rather than reduced with a remainder — and each block is shuffled with the Fisher–Yates algorithm. In stratified mode, each stratum's list comes from the seed plus the stratum name, so adding participants to one stratum never changes another's. A blank seed is filled from crypto.getRandomValues.

Generating the list is only half of randomization

Allocation concealment means the person enrolling a participant cannot know or influence the next assignment. Generate the whole list before recruitment starts, hold it with someone who does not enroll participants, and reveal each assignment only after that person has consented — through sequentially numbered, opaque, sealed envelopes or a central service. CONSORT asks trials to report both how the sequence was generated and how it was concealed (Schulz, Altman & Moher, 2010). Concealment is not the same as blinding, which hides the assignment after it is made.

Frequently Asked Questions

What is the difference between random assignment and random sampling?
Random sampling decides who is in the study, so results can generalize to the population. Random assignment decides which condition each participant receives, so differences between groups can be attributed to the condition rather than to who chose it. An experiment can use one without the other.
What block size should I use for block randomization?
A common choice is two or three times the number of conditions — blocks of 4 or 6 for two groups. Small blocks keep the groups tightly balanced but are easier to predict, so trials often mix sizes at random, such as 4 and 6, and never tell recruiters what they are.
Can I reproduce a randomization list later?
Yes. The list depends only on the seed and the inputs: the participants, the conditions in the order listed, the method and the block sizes. Record all of them, and anyone can regenerate the identical list here to check it.
What is stratified randomization?
It runs a separate block-randomized list inside each subgroup, or stratum, defined by a variable that strongly affects the outcome, such as study site or disease severity. Each stratum stays balanced across conditions, so the groups end up similar on that variable. With many strata and few participants, blocks are left incomplete and the benefit fades.
How do I randomize with a 2:1 ratio?
List the larger condition twice, for example Treatment, Treatment, Control. Each draw then has a two-in-three chance of Treatment, and every permuted block holds twice as many Treatment slots, so block sizes must be multiples of three, such as 3, 6 or 9.
Can I use this generator for a clinical trial?
It suits student projects, pilots and small studies, and the seed makes the list auditable. Regulated trials normally require a validated, access-controlled randomization service that also handles concealment and an audit log, so use this to plan or prototype the scheme rather than to run one.

Related Tools

More in Research & Publishing

See all Research & Publishing