Random Assignment Generator

Assign participants to conditions with block randomization and a reproducible seed you can report in your methods.

Runs entirely in your browserFree · no signup

1. Your participants

Up to 5,000.

IDs are zero-padded so they sort correctly.

60 participants

2. Your conditions and method

One per line. Two or more.

Guarantees near-equal group sizes throughout recruitment. The right default for most experiments.

Block size = 2. Larger blocks are harder for a researcher to predict, smaller blocks stay more balanced.

Report this in your methods and anyone can regenerate the exact same allocation.

3. Allocation

Total assigned
60
Control
30

50.0%

Treatment
30

50.0%

Groups are perfectly balanced

Block randomization deals out a balanced block of 2 at a time, so imbalance can never exceed the size of an incomplete final block.

Randomize before you recruit, not after

Generate the full allocation list first, then assign each participant the next condition on the list as they arrive. Deciding a participant's condition after you have met them — or reshuffling because a group looks uneven — reintroduces exactly the selection bias randomization exists to remove.

All 60 assignments
ParticipantConditionBlock
P01Treatment1
P02Control1
P03Treatment2
P04Control2
P05Treatment3
P06Control3
P07Treatment4
P08Control4
P09Treatment5
P10Control5
P11Treatment6
P12Control6
P13Control7
P14Treatment7
P15Control8
P16Treatment8
P17Treatment9
P18Control9
P19Control10
P20Treatment10
P21Control11
P22Treatment11
P23Treatment12
P24Control12
P25Treatment13
P26Control13
P27Control14
P28Treatment14
P29Control15
P30Treatment15
P31Treatment16
P32Control16
P33Control17
P34Treatment17
P35Control18
P36Treatment18
P37Treatment19
P38Control19
P39Control20
P40Treatment20
P41Control21
P42Treatment21
P43Treatment22
P44Control22
P45Control23
P46Treatment23
P47Treatment24
P48Control24
P49Treatment25
P50Control25
P51Control26
P52Treatment26
P53Control27
P54Treatment27
P55Treatment28
P56Control28
P57Control29
P58Treatment29
P59Control30
P60Treatment30

4. Copy for your methods section

Reporting the seed is what makes your randomization verifiable rather than just claimed.

Randomization procedure
Randomization procedure

60 participants were randomly assigned to 2 conditions (Control, Treatment) using block randomization with a block size of 2.
Allocation was generated with a seeded pseudorandom number generator (seed = "42"), making the sequence reproducible.

Resulting group sizes: Control n = 30, Treatment n = 30.

Why random assignment matters

Random assignment is what separates an experiment from an observational study, and it is the only reason you can make a causal claim. By allocating participants to conditions by chance, you distribute every other characteristic — motivation, ability, mood, prior experience, the variables you thought of and the ones you didn’t — evenly across groups on average.

That is a stronger guarantee than any amount of statistical control. Controlling for confounds requires you to have measured them; random assignment handles the ones you never thought of.

Note the distinction from random sampling, which is how you choose who takes part and governs whether your findings generalize. Random assignment governs whether you can claim causation. They are independent, and most student projects have the second without the first.

Block randomization, concretely

Suppose you have two conditions and recruit 40 participants over a semester. With simple randomization, each person is assigned independently — and a 25/15 split is a perfectly plausible outcome. That costs you statistical power and makes the groups harder to compare.

Block randomization fixes this. With a block size of 4, the generator creates a balanced set — two Control, two Treatment — shuffles it, and deals it out. Then it does the same for the next four participants. The result is that after every complete block the groups are exactly equal, so imbalance can never exceed one incomplete final block.

The trade-off is predictability. With a block of 4 and two conditions, someone who knows the design and has seen the first three allocations can deduce the fourth. In a blinded clinical trial that matters and you would use larger or randomly varying blocks. In a student project run by one person who already knows the design, it usually doesn’t.

The reproducibility argument for seeds

“Participants were randomly assigned” is an unverifiable claim. Nobody can check it, including you, six months later when a reviewer asks.

A seeded generator makes it checkable. The seed is a number that determines the entire sequence, so reporting it means anyone can regenerate your exact allocation list and confirm it matches your data. That closes off a real questionable-research-practice route — quietly reshuffling until the groups look convenient — because with a reported seed, the allocation you published is the allocation you used.

Generate a fresh seed for each study, note it in your lab book alongside the date, and include it in your methods section. The copy-ready block above writes the sentence for you.

Practical workflow

  1. Work out your target sample size first — the sample size calculator covers this.
  2. Generate the full allocation list before recruiting, at your target n plus a margin for dropout.
  3. Download the CSV and keep it as your master allocation record.
  4. As each participant arrives, assign them the next unused row. Never skip ahead or choose.
  5. Record the seed and block size in your methods section.

Frequently asked questions

What's the difference between simple and block randomization?
Simple randomization assigns each participant independently, like flipping a coin per person — genuinely random, but group sizes drift apart, and with 40 participants a 25/15 split is entirely possible. Block randomization deals out balanced blocks (for two conditions with a block of 4: two of each, shuffled), so the groups stay near-equal at every point in recruitment. Block is the right default for most experiments.
Why does the seed matter?
It makes your randomization reproducible and therefore verifiable. Reporting 'participants were randomly assigned using a seeded generator (seed = 42)' lets anyone regenerate your exact allocation and confirm you didn't reshuffle until you liked the result. That's a genuine transparency gain over an unreportable Math.random() call.
Is a seeded generator random enough for a real experiment?
Yes, for allocation purposes. This uses mulberry32, a well-distributed pseudorandom generator, with a Fisher-Yates shuffle — the correct unbiased shuffling algorithm. For an experiment allocation that is entirely adequate. It is not cryptographically secure, so don't use it for anything security-related, but that isn't what randomizing participants requires.
What block size should I choose?
A block equal to the number of conditions (multiplier 1) keeps the tightest balance but is the most predictable: with two conditions, whoever knows the design knows every second allocation. Larger blocks are harder to predict at the cost of slightly looser balance. For a single-researcher student project, predictability rarely matters; in a clinical trial with blinding, use larger or varying blocks.
Should I randomize before or during recruitment?
Before. Generate the whole allocation list up front, then assign each participant the next condition as they arrive. Deciding after you've met someone — or reshuffling because a group looks uneven — reintroduces precisely the selection bias randomization exists to eliminate.
My groups came out uneven. Should I regenerate?
No. Regenerating until the groups look how you want is not randomization — it's selection with extra steps, and it's a form of researcher degrees of freedom. If you need balance, switch to block randomization before you start. If you're already recruiting with simple randomization, uneven groups are a legitimate and reportable outcome.
What about matching participants on age or gender?
That's stratified randomization: split participants into strata (age bands, gender) and randomize within each. This tool doesn't do it directly, but you can achieve the same thing by running it once per stratum — paste the IDs for each group separately, keeping the same seed logic, and combine the results. Report that you stratified and on which variables.

Related free tools

Need the whole analysis, not just this step?

Analytika picks the right test for your data, checks the assumptions, and writes up the results in APA format. Upload a dataset and ask a question in plain English.

Try it free