Heparan sulfate (HS) has been implicated in a wide range of cell signaling. Here we report a novel mechanism in which extracellular removal of 6-O-sulfate groups from HS by the endosulfatases, Sulf1 and Sulf2, is essential for axon guidance during development. In Sulf1/2 double knockout (DKO) mice, the corticospinal tract (CST) was dorsally displaced on the midbrain surface. In utero electroporation of Sulf1/2 into radial glial cells along the third ventricle, where Sulf1/2 mRNAs are normally expressed, rescued the CST defects in the DKO mice. Proteomic analysis and functional testing identified Slit2 as the key molecule associated with the DKO phenotype. In the DKO brain, 6-O-sulfated HS was increased, leading to abnormal accumulation of Slit2 protein on the pial surface of the cerebral peduncle and hypothalamus, which caused dorsal repulsion of CST axons. Our findings indicate that postbiosynthetic desulfation of HS by Sulfs controls CST axon guidance through fine-tuning of Slit2 presentation.