Previous studies of nasopharyngeal carcinoma (NPC) have found elevated risks with higher consumption of salted fish and preserved foods, particularly during childhood. These foods can contain high levels of nitrosamines; however, most studies have not estimated exposure to nitrosamines directly. We conducted a case-control study in Taiwan to evaluate dietary intakes and NPC risk. A total of 375 cases (99% response rate) and 327 controls (88% response rate) were interviewed about their diet as an adult and at age 10 using a food-frequency questionnaire. We interviewed mothers of participants about their child's diet at age 10, age 3 and during weaning and the mother's diet while she was breast-feeding. Mothers of 96 cases and 120 controls were interviewed. Nitrosamine and nitrite levels were assigned to 66 foods based on published values. Intake of nitrosamines and nitrite as an adult was not associated with risk of NPC. High intakes of nitrosamines and nitrite during childhood and weaning were associated with increased risks of NPC for foods other than soy products. Adjusted odds ratios for the highest quartile were 2.2 [95% confidence interval (CI) 0.8-5.6] for age 10, 2.6 (95% CI 1.0-7.0) for age 3 and 3.9 (95% CI 1.4-10.4) for weaning diet. Intakes of nitrite and nitrosamines from soybean products during childhood and weaning were inversely associated with risk. Soybeans contain known inhibitors of nitrosation, and thus may explain the inverse association we observed. Our results suggest that nitrosamine and nitrite intake during childhood may play a role in the development of NPC.