Myelination is essential for rapid impulse conduction in the CNS, but what determines whether an individual axon becomes myelinated remains unknown. Here we show, using a myelinating coculture system, that there are two distinct modes of myelination, one that is independent of neuronal activity and glutamate release and another that depends on neuronal action potentials releasing glutamate to activate NMDA receptors on oligodendrocyte lineage cells. Neuregulin switches oligodendrocytes from the activity-independent to the activity-dependent mode of myelination by increasing NMDA receptor currents in oligodendrocyte lineage cells 6-fold. With neuregulin present myelination is accelerated and increased, and NMDA receptor block reduces myelination to far below its level without neuregulin. Thus, a neuregulin-controlled switch enhances the myelination of active axons. In vivo, we demonstrate that remyelination after white matter damage is NMDA receptor-dependent. These data resolve controversies over the signalling regulating myelination and suggest novel roles for neuregulin in schizophrenia and in remyelination after white matter damage.