Mexico is a landlocked municipality in the coastal province of Pampanga.
The municipality has a land area of 117.41 square kilometers or 45.33 square miles which constitutes 5.87% of Pampanga's total area. Its population as determined by the 2020 Census was 173,403. This represented 7.11% of the total population of Pampanga province, or 1.40% of the overall population of the Central Luzon region. Based on these figures, the population density is computed at 1,477 inhabitants per square kilometer or 3,825 inhabitants per square mile.