Sustainable development goal 2 aims to end hunger in all its forms by 2030, achieved through a joint policy strategy on raising food production and food access. Most model-based projections on undernourishment towards 2050 focus on sustainably producing enough food, rather than on ending hunger. We compare policy strategies on food supply and food access to lower undernourishment in 2040 for 151 countries. Here, we show that in a Business-as-Usual scenario (BaU) 3.3% of the world population is undernourished by 2040. We develop 27 regional policy target-scenarios on Producing More Food (PMF), Raising average Caloric Consumption (RCC) and within-country Equal Food Distribution (EFD). RCC lowers undernourishment to 2.2%, followed by EFD (2.6%) and PMF (2.7%). For world regions results are mixed, with either RCC or EFD generating the strongest reduction in undernourishment. For individual countries, 90 countries achieve SDG2 in 2040 in the BaU-scenario. In PMF, 18 additional countries achieve SDG2, versus 30 countries in EFD and 38 countries in RCC. Both food supply and food access policy strategies can achieve SDG2, but raising food access results in greater progress at all scales. Long-term food security studies should move beyond environmentally sustainable agricultural policy strategies, as socio-economic policies on food access and inequality policies will determine the future of food security.