Anemia is prevalent in pregnant women, and the causes include inadequate diet, increased demand for iron, and inflammation. We hypothesized that gestational diabetes mellitus (GDM) and hepcidin-related gene polymorphisms may contribute to maternal anemia and that an anti-inflammatory diet can alleviate this negative effect. The aim of this study was to investigate the association of an inflammatory diet, GDM, and single nucleotide polymorphisms (SNPs) in hepcidin-related genes, which are key regulators of iron, with maternal anemia. This was a secondary data analysis of a prospective prenatal diet and pregnancy outcome study in Japan. The Energy-Adjusted Dietary Inflammatory Index was calculated using a brief self-administered diet history questionnaire. We analyzed 121 SNPs in 4 genes: TMPRS6 (43 SNPs), TF (39 SNPs), HFE (15 SNPs), and MTHFR (24 SNPs). Multivariate regression analysis was conducted to determine the association between the first variable and maternal anemia. The prevalence of anemia in first, second, and third trimesters were 5.4%, 34.9%, and 45.8%, respectively. The pregnant women with GDM had a significantly higher incidence of moderate anemia than those without GDM (40.0% vs. 11.4%, P = .029). In multivariate regression analysis, Energy-adjusted Dietary Inflammatory Index (β = −0.057, P = .011) and GDM (β = −0.657, P = .037) were significantly associated with hemoglobin levels during the third trimester. Using Stata's qtlsnp command, TMPRSS6 rs2235321 was found to be associated with hemoglobin levels during the third trimester. These results indicate that inflammatory diets, GDM, and TMPRSS6 rs2235321 polymorphism are associated with maternal anemia. This result suggests that a pro-inflammatory diet and GDM are associated with maternal anemia.