The global biodiversity crisis concerns not only unprecedented loss of species within communities, but also related consequences for ecosystem function. Community ecology focuses on patterns of species richness and community composition, whereas ecosystem ecology focuses on fluxes of energy and materials. Food webs provide a quantitative framework to combine these approaches and unify the study of biodiversity and ecosystem function. We summarise the progression of food-web ecology and the challenges in using the food-web approach. We identify five areas of research where these advances can continue, and be applied to global challenges. Finally, we describe what data are needed in the next generation of food-web studies to reconcile the structure and function of biodiversity.