NdFeB magnet waste is one of the important secondary resources from which rare-earth elements (REEs) can be recovered. Herein we present an electrochemical route to selectively extract REEs from the magnet waste at room temperature. First, the magnet waste was partially leached with HCl. The partial leachate along with undissolved magnet waste was taken in the anolyte side of a two compartment reactor separated by an anion exchange membrane whereas the catholyte consisted of sodium chloride solution. The Fe(ii) present in the leachate was oxidized and precipitated as Fe(OH)3 while more than 95% of REEs were extracted into the solution. Subsequently, oxalic acid was used to selectively precipitate REEs as rare-earth oxalates. Hydrochloric acid liberated during the oxalic acid precipitation process could be directly reused in the partial leaching step. Sodium chloride was the only chemical consumed during the electrolysis. The effect of the NaCl concentration in the anolyte and catholyte on the extraction of metals was investigated. From magnet waste to rare-earth oxides, the developed recycling process is environmentally friendly and consumes only electricity, NaCl and oxalic acid.