A number of extant and extinct archosaurs evolved an elongate, narrow rostrum. This longirostrine condition has been associated with a diet comprising a higher proportion of fish and smaller prey items compared to taxa with broader, more robust snouts. The evolution of longirostrine morphology and a bulbous anterior rosette of premaxillary teeth also occurs in the spinosaurid theropod dinosaurs, leading to suggestions that at least some members of this clade also had a diet comprising a notable proportion of fish or other small vertebrates. Here we compare the rostral biomechanics of the spinosaurs Baryonyx walkeri and Spinosaurus c.f. S. aegyptiacus to three extant crocodilians: two longistrine taxa, the African slender-snouted crocodile Mecistops cataphractus and the Indian gharial Gavialis gangeticus; and the American alligator Alligator mississippiensis. Using computed tomography (CT) data, the second moments of area and moments of inertia at successive transverse slices along the rostrum were calculated for each of the species. Size-independent results tested the biomechanical benefits of material distribution within the rostra. The two spinosaur rostra were both digitally reconstructed from CT data and compared against all three crocodilians. Results show that African slender-snouted crocodile skulls are more resistant to bending than an equivalent sized gharial. The alligator has the highest resistances to bending and torsion of the crocodiles for its size and greater than that of the spinosaurs. The spinosaur rostra possess similar resistance to bending and torsion despite their different morphologies. When size is accounted for, B. walkeri performs mechanically differently from the gharial, contradicting previous studies whereas Spinosaurus does not. Biomechanical data support known feeding ecology for both African slender-snouted crocodile and alligator, and suggest that the spinosaurs were not obligate piscivores with diet being determined by individual animal size.