Two-Arm Study Number Generator
Generate random allocation sequences for two-arm clinical studies with block randomization, configurable ratios, and CSV export.
About
Improper randomization in a two-arm study introduces selection bias. This corrupts your treatment effect estimate and can invalidate months of data collection. Regulatory bodies (FDA, EMA) require documented, reproducible allocation sequences that demonstrate concealment. Simple coin-flip methods produce unacceptable imbalance in small samples. A study with n = 30 using pure random assignment has roughly a 10% chance of a split worse than 20/10. This tool uses permuted block randomization with cryptographically secure entropy from the Web Crypto API, not Math.random(). It supports allocation ratios from 1:1 to 3:1, variable block sizes to prevent prediction, and exports audit-ready CSV files. Note: this tool does not replace a validated IWRS system for Phase III trials. It is appropriate for investigator-initiated studies, pilot trials, and educational use.
Formulas
In permuted block randomization with allocation ratio r:1, each block contains b subjects. Within a block of size b, the number of subjects assigned to Arm A and Arm B is fixed:
where k is the block multiplier (a positive integer). The block is then shuffled using a Fisher-Yates permutation seeded by cryptographic entropy. The number of possible permutations within one block is:
For a 1:1 ratio with block size 4: 4!2! ⋅ 2! = 6 possible arrangements. For block size 6: 20 arrangements. Variable block sizes are drawn uniformly from a user-specified set to prevent sequence prediction.
where r = allocation ratio (Arm A : Arm B), k = block multiplier, b = block size, nA = subjects per block assigned to Arm A, nB = subjects per block assigned to Arm B.
Reference Data
| Randomization Method | Balance Guarantee | Predictability Risk | Best Use Case | Minimum Sample Size |
|---|---|---|---|---|
| Simple (Coin Flip) | None | None | Large trials (n > 200) | 200+ |
| Fixed Block | Within each block | High (if block size known) | Small balanced trials | 10 |
| Variable Block | Within each block | Low | Most RCTs | 20 |
| Stratified Block | Within stratum & block | Low | Multi-site or covariate-adjusted | 30 |
| Minimization | Adaptive | Moderate | Small trials with many covariates | 50 |
| Biased Coin | Probabilistic | Low | Moderate sample sizes | 40 |
| Urn (Wei) | Adaptive | Low | Sequential enrollment | 30 |
| Block Size 2 (1:1) | Every 2 subjects | Very High | Not recommended (too predictable) | - |
| Block Size 4 (1:1) | Every 4 subjects | Moderate | Common default | 12 |
| Block Size 6 (1:1) | Every 6 subjects | Low | Preferred for open-label | 18 |
| Block Size 4 (2:1) | Every 6 subjects (4A+2B) | Moderate | Unequal allocation | 18 |
| Block Size 8 (1:1) | Every 8 subjects | Very Low | Large single-site trials | 24 |
| ICH E9 Recommendation | Block-based | - | Regulatory submission trials | - |
| CONSORT Requirement | Documented method | - | All published RCTs | - |