Groundwater depletion due to agricultural intensification is a major threat to water and food security in the Indo-Gangetic Plain (IGP). This study developed and applied a crop switching optimization model for cereals in the IGP to maximize calorie production and farmers' profits and minimize water consumption. Switching from rice to millets and sorghum in the Kharif season and from wheat to sorghum in the Rabi season could potentially reduce water consumption by 32%, improve calorie production by 39%, and increase farmers' profits by 140%. Crop switching offers a larger reduction in groundwater depletion and energy savings than improving irrigation efficiency.