Background/aims:The stepped-wedge design has been extensively studied in the setting of the cluster randomized trial, but less so for the individually randomized trial. This article derives the optimal allocation of individuals to treatment sequences. The focus is on designs where all individuals start in the control condition and at the beginning of each time period some of them cross over to the intervention, so that at the end of the trial all of them receive the intervention.Methods:The statistical model that takes into account the nesting of repeated measurements within subjects is presented. It is also shown how possible attrition is taken into account. The effect of the intervention is assumed to be sustained so that it does not change after the treatment switch. An exponential decay correlation structure is assumed, implying that the correlation between any two time point decreases with the time lag. Matrix algebra is used to derive the relation between the allocation of units to treatment sequences and the variance of the treatment effect estimator. The optimal allocation is the one that results in smallest variance.Results:Results are presented for three to six treatment sequences. It is shown that the optimal allocation highly depends on the correlation parameterρand attrition raterbetween any two adjacent time points. The uniform allocation, where each treatment sequence has the same number of individuals, is often not the most efficient. For0.1≤ρ≤0.9andr=0,0.05,0.2, its efficiency relative to the optimal allocation is at least 0.8. It is furthermore shown how a constrained optimal allocation can be derived in case the optimal allocation is not feasible from a practical point of view.Conclusion:This article provides the methodology for designing individually randomized stepped-wedge designs, taking into account the possibility of attrition. As such it helps researchers to plan their trial in an efficient way. To use the methodology, prior estimates of the degree of attrition and intraclass correlation coefficient are needed. It is advocated that researchers clearly report the estimates of these quantities to help facilitate planning future trials.