Skip to content

Latin Square Counterbalancing Generator

Type your conditions and get a balanced Latin square — a Williams design in which every condition appears once in every position and immediately follows every other condition equally often — or a simple cyclic square for comparison. Assign participants to the orders, randomize the letters if you like, and copy or download the result. Free, no sign-up.

Between 2 and 26 conditions, each listed once.

Design

Orders

4 conditions, 4 orders: one balanced Latin square.

  • Every condition appears equally often in every position.
  • Every condition is immediately followed by every other condition exactly once.
OrderCodePosition 1Position 2Position 3Position 4
Order 1ABDCSilenceWhite noiseLyrical musicInstrumental music
Order 2BCADWhite noiseInstrumental musicSilenceLyrical music
Order 3CDBAInstrumental musicLyrical musicWhite noiseSilence
Order 4DACBLyrical musicSilenceInstrumental musicWhite noise

A = Silence; B = White noise; C = Instrumental music; D = Lyrical music

Participants

ParticipantOrderSequence
P011Silence → White noise → Lyrical music → Instrumental music
P022White noise → Instrumental music → Silence → Lyrical music
P033Instrumental music → Lyrical music → White noise → Silence
P044Lyrical music → Silence → Instrumental music → White noise
P051Silence → White noise → Lyrical music → Instrumental music
P062White noise → Instrumental music → Silence → Lyrical music
P073Instrumental music → Lyrical music → White noise → Silence
P084Lyrical music → Silence → Instrumental music → White noise

How to Use the Latin Square Counterbalancing Generator

  1. 1. List the conditions. One per line or separated by commas — from 2 to 26, each listed once. The starting example is a memory experiment with four background-sound conditions.
  2. 2. Choose the design. Balanced (Williams) controls first-order carryover. Simple cyclic only balances position and is there for comparison.
  3. 3. Enter the number of participants. Participants cycle through the orders, so each order is used equally often whenever the number of participants is a multiple of the number of orders.
  4. 4. Randomize if you want to. Randomize letters and assignment shuffles which condition takes each letter and which participant gets which order, from a seed shown on screen. The balance does not change.
  5. 5. Copy or download. Copy the orders into your protocol and download the participant list as CSV.

Order Effects and Counterbalancing

In a within-subjects design every participant experiences every condition, so the order of the conditions becomes a variable of its own. Position effects — practice, fatigue, boredom — help or hurt whatever comes later. Carryover effects are sequence effects: one condition changes how the next one is experienced, as when a stressful task colors a calm one. Counterbalancing spreads these influences evenly across the conditions so they cannot pass for an effect of the conditions themselves.

Complete counterbalancing uses every possible order, and there are n! of them: 24 for four conditions, 120 for five, 720 for six — soon more orders than participants. A Latin square uses just n orders (2n in the balanced version for an odd number of conditions), in which every condition appears exactly once in every position.

How the Balanced Latin Square Is Built

The balanced square is Williams' (1949) design. Its first row follows the pattern 1, 2, n, 3, n − 1, 4, n − 2, … (Bradley, 1958), and each later row adds 1 to every entry, wrapping from n back to 1. For four conditions, A B D C becomes B C A D, then C D B A, then D A C B — and in those four orders every condition is immediately followed by every other condition exactly once. With the example's sound conditions, the generator shows:

OrderCodeSequence
1ABDCSilence → White noise → Lyrical music → Instrumental music
2BCADWhite noise → Instrumental music → Silence → Lyrical music
3CDBAInstrumental music → Lyrical music → White noise → Silence
4DACBLyrical music → Silence → Instrumental music → White noise

When the number of conditions is odd, the same construction cannot balance carryover in one square: for three conditions, A B C, B C A and C A B put A before B twice and B before A never. Williams' solution is to add the mirror image — every order reversed — for 2n orders in which each condition follows every other exactly twice. For three conditions that gives ABC, BCA, CAB, CBA, ACB and BAC, which happens to be all six possible orders; for five it gives ten orders, starting A B E C D.

The cyclic square — A B C D, B C D A, C D A B, D A B C — also puts every condition once in every position, but A is always followed by B, so any carryover from A always lands on B. The checks under the table say so as soon as you switch to it.

Assigning Participants to Orders

Recruit in multiples of the number of orders — 4, 8, 12 for four conditions; 6, 12, 18 for three — so every order is used equally often; the generator warns when your number is not a multiple. With the starting 8 participants, P01 and P05 follow order 1, P02 and P06 order 2, and so on. Randomizing the letters breaks any link between the order you happened to type the conditions in and the design, and randomizing which participant gets which order matters when people enroll over weeks rather than all at once.

A balanced Latin square evens out first-order carryover; it does not remove it. Effects that last longer than one condition, or that run more strongly in one direction than the other, can still bias the results. Leave washout breaks between conditions where carryover is plausible, and include order or sequence in the analysis so you can check for it.

Frequently Asked Questions

What is a balanced Latin square?
It is a set of condition orders in which every condition appears once in every position and every condition immediately follows every other condition equally often. That second property balances first-order carryover, which an ordinary Latin square does not. The construction most courses teach is Williams' design.
Why does the balanced design use two squares for an odd number of conditions?
An n × n square has exactly n(n − 1) adjacent pairs, the same as the number of ordered pairs of conditions, so balance needs every pair exactly once. Williams' construction achieves that only when n is even; with an odd n some pairs appear twice and others never. Adding the mirror image of the square supplies the missing pairs, so across the 2n orders every condition follows every other exactly twice.
How many participants do I need for a Latin square design?
Use a multiple of the number of orders: 4, 8, 12 and so on for four conditions, and 6, 12, 18 for three, because odd numbers of conditions need 2n orders. The total also has to give enough statistical power for your effect, so choose the multiple with a power analysis.
What is the difference between counterbalancing and randomizing the order?
Randomizing gives each participant an order chosen at random, which balances order effects only on average and can leave some sequences over-represented in a small sample. Counterbalancing with a Latin square fixes the set of orders so position and carryover are balanced exactly, and randomization is then used to decide which participant gets which order.
What is the difference between a Latin square and complete counterbalancing?
Complete counterbalancing uses all n! possible orders, which balances every kind of order effect but needs at least 24 participants for four conditions and 120 for five. A Latin square uses n or 2n orders and balances position and, in the balanced version, first-order carryover — usually enough, with far fewer participants.
How do I describe counterbalancing in a methods section?
Name the design, the number of orders and how participants were assigned, for example: condition order was counterbalanced with a balanced Latin square (Williams, 1949) of four orders, and participants were assigned to orders in rotation. If you randomized the letters or the assignment, say so and record the seed.

Related Tools

More in Research & Publishing

See all Research & Publishing