Background: Pakistan has one of the highest levels of child and maternal undernutrition worldwide, but little information about geographical and socioeconomic inequalities is available. We aimed to analyse anthropometric indicators for childhood and maternal nutrition at a district level in Pakistan and assess the association of nutritional status with food security and maternal and household socioeconomic factors. Methods: We used data from the 2011 Pakistan National Nutrition Survey, which included anthropometric measurements for 33638 children younger than 5 years and 24 826 women of childbearing age. We estimated the prevalences of stunting, wasting, and underweight among children and of underweight, overweight, and obesity in women for all 143 districts of Pakistan using a Bayesian spatial technique. We used a mixed-effect linear model to analyse the association of nutritional status with individual and household sociodemographic factors and food security. Findings: Stunting prevalence in Pakistan's districts ranged between 22% (95% credible interval 19-26) and 76% (69-83); the lowest figures for wasting and underweight were both less than 2·5% and the highest were 42% (34-50) for wasting and 54% (49-59) for underweight. In 106 districts, more women were overweight than were underweight; in 49 of these districts more women were obese than were underweight. Children were better nourished if their mothers were taller or had higher weight, if they lived in wealthier households, and if their mothers had 10 or more years of education. Severe food insecurity was associated with worse nutritional outcomes for both children and women. Interpretation: We noted large social and geographical inequalities in child and maternal nutrition in Pakistan, masked by national and provincial averages. Pakistan is also beginning to face the concurrent challenge of high burden of childhood undernutrition and overweight and obesity among women of reproductive age. Planning, implementation, and evaluation of programmes for food and nutrition should be based on district-level needs and outcomes. Funding: Bill & Melinda Gates Foundation, Grand Challenges Canada, UK Medical Research Council.