The occurrence of anorectal malformations (ARM) is thought to be reduced with sufficient folate intake. However, there is no apparent evidence. We focused on enzyme cofactors for one-carbon metabolism, including folate (vitamin B9), vitamin B6 and vitamin B12, and explored the association between maternal combined intake of these B vitamins and the risk of ARM. Using baseline data from a Japanese nationwide birth cohort study between 2011 and 2014, we analysed data of 89 235 women (mean age at delivery = 31·2 years) who delivered singleton live births without chromosomal anomalies. Information on dietary intake was obtained via a FFQ focused on early pregnancy and used to estimate B vitamin intake. We also collected information on the frequency of folic acid supplement use. ARM occurrence was ascertained from medical records. We identified forty-three cases of ARM diagnosed up to the first month after birth (4·8 per 10 000 live births). In terms of individual intake of the respective B vitamins, high vitamin B6 intake was non-significantly associated with reduced odds of ARM. Compared with women in the low combined B vitamin intake group, the OR of having an infant with ARM was 0·4 (95 % CI 0·2, 1·0) in the high intake group (folate ≥400 μg/d, and upper half of vitamin B6 and/or vitamin B12). In conclusion, our cohort analysis suggested an inverse association between the combined intake of one-carbon metabolism-related B vitamins in early pregnancy and ARM occurrence.