Studies on the composition of fish diet and on how species exploit food resources are especially relevant in tropical freshwater systems, where dietary plasticity is a commonly used strategy. In this study, we analysed the food spectrum and the environmental, seasonal and ontogenetic variations in the diet of a characid species [Hemigrammus marginatus Ellis, 1911 (Characidae)] in the region of the Upper Contas River, in the Diamantina Plateau, Brazil. We verified an omnivorous/invertivorous and opportunistic food habit, with predominance of insects and microcrustaceans, followed by filamentous algae. Seasonality did not alter the food resources used by the species. However, differences were detected in the dominant categories when comparing the two sampled rivers, as well as in the food consumption throughout the development of the species. These data increase the knowledge about the biology of H. marginatus and allow understanding the influence of the characteristics of the rivers and their surroundings in the trophic ecology of the species, as our findings have shown that, although insects have been expressive in both studied localities, microcrustaceans exhibit a greater relative importance in the more lentic environment, which is probably related to the variation in the availability of these resources in the environment.