We present the first data that comprehensively quantify the interactive effects on an herbivore of a plant allelochemical and dietary macronutrients. Locusts (Locusta migratoria) were reared across the fifth larval stadium on one of 20 foods with fixed total macronutrient content (42%), but varying in protein:carbohydrate (P:C) ratio (7:35, 14:28, 21:21, 28:14, or 35:7) and tannic acid (TA) content (0, 3.3, 6.7, or 10%). The effects of the allelochemical on consumption, nutrient uptake, body composition, development rate, and survivorship were highly dependent on the balance of macronutrients in the food. Mortality was low and independent of TA on the near‐optimally balanced 21:21 food, but rose markedly with increasing TA levels as dietary P:C ratio became more unbalanced. The time course of deaths differed for excess P and excess C foods, suggesting different underlying causes. The major effect of TA in foods of low P:C ratio was to reduce the rate of intake, while TA in foods containing excess protein resulted in reduced nitrogen utilization efficiency. We interpret the mechanistic bases of the results and discuss their significance for foraging theory.