Fluoride pollution is becoming increasingly serious with industrial growth. Controlling fluoride pollution have become important environmental issues of global concern. Transition metal nitrides are excellent CDI electrode materials due to their excellent conductivity and electrochemical stability. In this study, FeNx/C was synthesized as an electrode material for using the capacitive deionization (CDI) technique to achieve the effective removal of fluoride ions from wastewater. Its high specific surface area (463.278 mg/g) and high capacitance (44.29 F/g) were demonstrated and it had a high adsorption capacity of 158.33 mg/g. FeN3 and FeN4 were used as the main sites as capacitive deionization for removing fluoride from the water by chemisorption and hydrogen bonding. The higher adsorption energy by density functional calculation also indicated that the existence of Fe-N coordination bond effectively improved its electrosorption capacity. This study is beneficial to provide references and research ideas for removing fluoride in the CDI field.