Despite over a century of interest, the function of zebra stripes has never been examined systematically. Here we match variation in striping of equid species and subspecies to geographic range overlap of environmental variables in multifactor models controlling for phylogeny to simultaneously test the five major explanations for this infamous colouration. For subspecies, there are significant associations between our proxy for tabanid biting fly annoyance and most striping measures (facial and neck stripe number, flank and rump striping, leg stripe intensity and shadow striping), and between belly stripe number and tsetse fly distribution, several of which are replicated at the species level. Conversely, there is no consistent support for camouflage, predator avoidance, heat management or social interaction hypotheses. Susceptibility to ectoparasite attack is discussed in relation to short coat hair, disease transmission and blood loss. A solution to the riddle of zebra stripes, discussed by Wallace and Darwin, is at hand.