Voltage-dependent sodium channels are uniformly distributed along unmyelinated axons, but are highly concentrated at nodes of Ranvier in myelinated axons. Here, we show that this pattern is associated with differential localization of distinct sodium channel α subunits to the unmyelinated and myelinated zones of the same retinal ganglion cell axons. In adult axons, Nav1.2 is localized to the unmyelinated zone, whereas Nav1.6 is specifically targeted to nodes. During development, Nav1.2 is expressed first and becomes clustered at immature nodes of Ranvier, but as myelination proceeds, Nav1.6 replaces Nav1.2 at nodes. In Shiverer mice, which lack compact myelin, Nav1.2 is found throughout adult axons, whereas little Nav1.6 is detected. Together, these data show that sodium channel isoforms are differentially targeted to distinct domains of the same axon in a process associated with formation of compact myelin.