Endogenous electric fields modulate many physiological processes by promoting directional migration, a process known as galvanotaxis. Despite the importance of galvanotaxis in development and disease, the mechanism by which cells sense and migrate directionally in an electric field remains unknown. Here, we show that electrophoresis of cell surface heparan sulfate (HS) critically regulates this process. HS was found to be localized at the anode-facing side in fetal neural progenitor cells (fNPCs), fNPCderived astrocytes and brain tumor-initiating cells (BTICs), regardless of their direction of galvanotaxis. Enzymatic removal of HS and other sulfated glycosaminoglycans significantly abolished or reversed the cathodic response seen in fNPCs and BTICs. Furthermore, Slit2, a chemorepulsive ligand, was identified to be colocalized with HS in forming a ligand gradient across cellular membranes. Using both imaging and genetic modification, we propose a novel mechanism for galvanotaxis in which electrophoretic localization of HS establishes cell polarity by functioning as a co-receptor and provides repulsive guidance through Slit-Robo signaling.