A sound, depending on the position of its source, can take more time to reach one ear than the other. This interaural ( between the ears) time difference (ITD) provides a major cue for determining the source location(1,2). Many auditory neurons are sensitive to ITDs(3,4), but the means by which such neurons represent ITD is a contentious issue. Recent studies question whether the classical general model ( the Jeffress model(5)) applies across species(6,7). Here we show that ITD coding strategies of different species can be explained by a unifying principle: that the ITDs an animal naturally encounters should be coded with maximal accuracy. Using statistical techniques and a stochastic neural model, we demonstrate that the optimal coding strategy for ITD depends critically on head size and sound frequency. For small head sizes and/or low-frequency sounds, the optimal coding strategy tends towards two distinct sub-populations tuned to ITDs outside the range created by the head. This is consistent with recent observations in small mammals(6,7). For large head sizes and/or high frequencies, the optimal strategy is a homogeneous distribution of ITD tunings within the range created by the head. This is consistent with observations in the barn owl(8-10). For humans, the optimal strategy to code ITDs from an acoustically measured distribution depends on frequency; above 400 Hz a homogeneous distribution is optimal, and below 400 Hz distinct sub-populations are optimal.