To comprehensively examine the associations between changes in carbohydrate intake and weight change at four year intervals. Prospective cohort study. Nurses' Health Study (1986-2010), Nurses' Health Study II (1991-2015), and Health Professionals Follow-Up Study (1986-2014). 136 432 men and women aged 65 years or younger and free of diabetes, cancer, cardiovascular disease, respiratory disease, neurodegenerative disorders, gastric conditions, chronic kidney disease, and systemic lupus erythematosus before baseline. Weight change within a four year period. The final analyses included 46 722 women in the Nurses' Health Study, 67 186 women in the Nurses' Health Study II, and 22 524 men in the Health Professionals Follow-up Study. On average, participants gained 1.5 kg (5th to 95th centile -6.8 to 10.0) every four years, amounting to 8.8 kg on average over 24 years. Among men and women, increases in glycemic index and glycemic load were positively associated with weight gain. For example, a 100 g/day increase in starch or added sugar was associated with 1.5 kg and 0.9 kg greater weight gain over four years, respectively, whereas a 10 g/day increase in fiber was associated with 0.8 kg less weight gain. Increased carbohydrate intake from whole grains (0.4 kg less weight gain per 100 g/day increase), fruit (1.6 kg less weight gain per 100 g/day increase), and non-starchy vegetables (3.0 kg less weight gain per 100 g/day increase) was inversely associated with weight gain, whereas increased intake from refined grains (0.8 kg more weight gain per 100 g/day increase) and starchy vegetables (peas, corn, and potatoes) (2.6 kg more weight gain per 100 g/day increase) was positively associated with weight gain. In substitution analyses, replacing refined grains, starchy vegetables, and sugar sweetened beverages with equal servings of whole grains, fruit, and non-starchy vegetables was associated with less weight gain. The magnitude of these associations was stronger among participants with overweight or obesity compared with those with normal weight (P<0.001 for interaction). Most of these associations were also stronger among women. The findings of this study highlight the potential importance of carbohydrate quality and source for long term weight management, especially for people with excessive body weight. Limiting added sugar, sugar sweetened beverages, refined grains, and starchy vegetables in favor of whole grains, fruit, and non-starchy vegetables may support efforts to control weight.