Variation in behavior within marine and terrestrial species can influence the functioning of the ecosystems they inhabit. However, the contribution of social behavior to ecosystem function remains underexplored. Many coral reef fish species provide potentially insightful models for exploring how social behavior shapes ecological function because they exhibit radical intraspecific variation in sociality within a shared habitat. Here, we provide an empirical exploration on how the ecological function of a shoaling surgeonfish (Acanthurus triostegus) may differ from that of solitary conspecifics on two Pacific coral reefs combining insight from behavioral observations, stable isotope analysis, and macronutrient analysis of gut and fecal matter. We detected important differences in how the social mode of A. triostegus affected its spatial and feeding ecology, as well as that of other reef fish species. Specifically, we found increased distance traveled and area covered by shoaling fish relative to solitary A. triostegus. Additionally, shoaling A. triostegus primarily grazed within territories of other herbivorous fish and had piscivorous and nonpiscivorous heterospecific fish associated with the shoal, while solitary A. triostegus grazed largely grazed outside of any territories and did not have any such interactions with heterospecific fish. Results from stable isotope analysis show a difference in δ15N isotopes between shoaling and solitary fish, which suggests that these different social modes are persistent. Further, we found a strong interaction between social behavior and site and carbohydrate and protein percentages in the macronutrient analysis, indicating that these differences in sociality are associated with measurable differences in both the feeding ecology and nutrient excretion patterns. Our study suggests that the social behavior of individuals may play an important and underappreciated role in mediating their ecological function.