Quantifying the diet of endangered species is crucial for conservation, especially for diet specialists, which can be more susceptible to environmental changes. The vulnerable fairy pitta (Pitta nympha) is considered a specialist that primarily feeds its nestlings with earthworms. However, there have been few studies of the nestling diet provisioned by parents, and no assessments of earthworm proportion in the diet of adults. Our study aimed to fill these gaps, shedding light on crucial factors for conservation. Combining new observations with existing literature, we confirmed a consistent dominance of earthworms in the nestling diet, regardless of rainfall, nestling age, and time of day. We extrapolated the total earthworm consumption during a breeding event, accounting for potential variation in the availability of earthworms and their prevalence in the adult diet. We used literature-based earthworm densities in pitta habitats and our estimates of family earthworm consumption to calculate the habitat area that could provide a pitta family with the number of earthworms consumed during a breeding event. The predictions matched observed pitta home range sizes when assumed that the adult diet is comprised of approximately 70% earthworms. The results highlight the importance of earthworm-rich habitats for conservation planning of the fairy pitta. To mitigate the effects of habitat destruction, we discuss conservation practices that may involve enhancing earthworm abundance in natural habitats and providing vegetation cover for foraging pittas in adjacent anthropogenic habitats rich in earthworms. To guide conservation efforts effectively, future studies should investigate whether previously reported breeding in developed plantation habitats is due to high earthworm abundance there. Future studies should also quantify correlations between local earthworm densities, home range size, and the breeding success of the fairy pitta.