By the swimmer's seed times coming into the race.
The middle lanes are the fastest, and the outer lanes are progressively slower (that's why the swimmers often seem to be in a V shape)
To be specific, the swimmer with the fastest time swims in lane 4, 2nd fastest in lane 5, third fastest in lane 3 fourth fastest in lane 6 fifth fastest in lane 2 sixth fastest in lane 7 seventh fastest in lane 1 eighth fastest in lane in lane 8.
Chat with our AI personalities
The competitors with the fastest qualifying times in the heats or semi-finals get the middle lanes, and lanes are assigned out from the middle in order of increasing qualifying time until the slowest qualifies get the outside lanes.