Objective To examine the association between household food insecurity and dietary diversity in the past 24h (dietary diversity score (DDS, range: 0-9); minimum dietary diversity (MDD, consumption of three or more food groups); consumption of nine separate food groups) among pregnant and lactating women in rural Malawi.Design Cross-sectional study.Setting Two rural districts in Central Malawi.Subjects Pregnant (n 589) and lactating (n 641) women.Results Of surveyed pregnant and lactating women, 66.7 and 68.6 %, respectively, experienced moderate or severe food insecurity and only 32.4 and 28.1 %, respectively, met MDD. Compared with food-secure pregnant women, those who reported severe food insecurity had a 0.36 lower DDS (P<0.05) and more than threefold higher risk (OR; 95 % CI) of not consuming meat/fish (3.19; CI 1.68, 6.03). The risk of not consuming eggs (3.77; 1.04, 13.7) was higher among moderately food-insecure pregnant women. Compared with food-secure lactating women, those who reported mild, moderate and severe food insecurity showed a 0.36, 0.44 and 0.62 lower DDS, respectively (all P<0.05). The risk of not achieving MDD was higher among moderately (1.95; 1.06, 3.59) and severely (2.82; 1.53, 5.22) food-insecure lactating women. The risk of not consuming meat/fish and eggs increased in a dose-response manner among lactating women experiencing mild (1.75; 1.01, 3.03 and 2.81; 1.09, 7.25), moderate (2.66; 1.47, 4.82 and 3.75; 1.40, 10.0) and severe (5.33; 2.63, 10.8 and 3.47; 1.19, 10.1) food insecurity.Conclusions Addressing food insecurity during and after pregnancy needs to be considered when designing nutrition programmes aiming to increase dietary diversity in rural Malawi.