Fish biologists have long assumed a link between intestinal length and diet, and relative gut length or Zihler’s index are often used to classify species into trophic groups. This has been done for specific fish taxa or specific ecosystems, but not for a global fish dataset. Here, we assess these relationships across a dataset of 468 fish species (254 marine, 191 freshwater, and 23 that occupy both habitats) in relation to body mass and fish length. Herbivores had significantly relatively stouter bodies and longer intestines than omni- and faunivores. Among faunivores, corallivores had longer intestines than invertivores, with piscivores having the shortest. There were no detectable differences between herbivore groups, possibly due to insufficient understanding of herbivorous fish diets. We propose that reasons for long intestines in fish include (i) difficult-to-digest items that require a symbiotic microbiome, and (ii) the dilution of easily digestible compounds with indigestible material (e.g., sand, wood, exoskeleton). Intestinal indices differed significantly between dietary groups, but there was substantial group overlap. Counter-intuitively, in the largest dataset, marine species had significantly shorter intestines than freshwater fish. These results put fish together with mammals as vertebrate taxa with clear convergence in intestine length in association with trophic level, in contrast to reptiles and birds, even if the peculiar feeding ecology of herbivorous fish is probably more varied than that of mammalian herbivores.