1. Dietary specialization is common in animals and has important implications for individual fitness, inter- and intraspecific competition, and the adaptive potential of a species. Differences in diet composition have been well-studied in shorebirds and their allies (Charadriiformes) and can be influenced by an individual’s morphology, social status, and acquired skills. In particular, sexual size dimorphism is thought to facilitate resource partitioning in some shorebird species. 2. We assessed the role of age- and sex-related dietary specialization in facilitating resource partitioning between seasons and among demographic groups in the sexually dimorphic western sandpiper (Calidris mauri). Using stable isotope mixing models, we quantified the contribution of biofilm, microphytobenthos, and benthic invertebrates to the diets of western sandpipers during mid-winter (January/February) and at the onset of the breeding migration (April). 3. Diet composition differed between seasons, among demographic groups, and among demographic groups within each season. In winter, prey consumption was similar among demographic groups, but, in spring, diet composition differed among demographic groups with bill length and body mass explaining 31% of the total variation in diet composition. Epifaunal invertebrates made up a greater proportion of the diet in males which had lesser mass and shorter bills than females. Consumption of Polychaeta increased with increasing bill length and was greatest in adult females. In contrast, consumption of microphytobenthos, thought to supply nutrition for migrating sandpipers, increased with decreasing bill length and was greatest in juvenile males. 4. Our results provide evidence that age- and sex-related dietary specialization in western sandpipers facilitate seasonal resource partitioning that would reduce competition during spring at the onset of the breeding migration. 5. Understanding resource partitioning throughout the annual cycle and among different demographic groups is critical because dietary specialization has important implications for the ecology, evolution, and conservation of a species.