Balanced Latin Square Generator

A Latin square is "an n × n array filled with n different symbols, each occurring exactly once in each row and exactly once in each column".

Latin squares are useful to reduce order-effects when designing empirical experiments with multiple conditions. For example, in an experimental design comparing a prototype A vs B vs C, if all participants test A first, then B, then C, we might observe poor results for C because of participants' fatigue and not because C is worse than A or B. Instead, we can order conditions based on a Latin square like this:

Note: You can quickly insert your conditions using copy-paste (separated by lines) | Download .csv

A condition will precede another exactly once (or twice, if the number of conditions is odd). This page uses the method that James V. Bradley proposed and mathematically proved [1].

Bradley, J. V. (1958). Complete counterbalancing of immediate sequential effects in a Latin square design. Journal of the American Statistical Association, 53(282), 525-528.