Throughout early neurodevelopment, myelination helps provide the foundation for brain connectivity and supports the emergence of cognitive and behavioral functioning. Early life nutrition is an important and modifiable factor that can shape myelination and, consequently, cognitive outcomes. Differences in the nutritional composition between human breast and formula milk may help explain the functional and cognitive disparity often observed between exclusively breast versus formula-fed children. However, past cognitive and brain imaging studies comparing breast and formula feeding are often: cross-sectional; performed in older children and adolescents relying on parental recall of infant feeding; and generally treat formula-fed children as a single group despite the variability between formula compositions. Here we address some of these weakness by examining longitudinal trajectories of brain and neurocognitive development in children who were exclusively breastfed versus formula-fed for at least 3 months. We further examine development between children who received different formula compositions. Results reveal significantly improved overall myelination in breastfed children accompanied by increased general, verbal, and non-verbal cognitive abilities compared to children who were exclusively formula-fed. These differences were found to persist into childhood even with groups matched for important socioeconomic and demographic factors. We also find significant developmental differences depending on formula composition received and that, in particular, long-chain fatty acids, iron, choline, sphingomyelin and folic acid are significantly associated with early myelination trajectories. These results add to the consensus that prolonged and exclusive breastfeeding plays an important role in early neurodevelopment and childhood cognitive outcomes.