This study presents a novel, one-step synthesis of nitrogen and fluorine bifunctional hierarchical porous carbons (HPCs) for capacitive deionization (CDI). The method involves co-gelation of silica and polyvinylidene fluoride, followed by pyrolysis for efficient silica removal. This method eliminates the need for toxic solvents and extensive cleaning steps. Optimized HPCs exhibit a high surface area (1464.71 m2/g) with abundant mesopores. Electrochemical analysis reveals a specific capacitance of 179.5F/g. In the CDI process using 500 mg/L NaCl solution, the HPCs demonstrate exceptional performance with a high salt adsorption capacity (24.61 mg/g) and a fast average adsorption rate (3.69 mg/g/min). This performance is attributed to the combined effects of the hierarchical pore structure facilitating rapid ion adsorption and the N/F bifunctional groups enhancing electrosorption ability. This work offers a one-step, solvent-free method for synthesizing HPCs with superior desalination performance and demonstrates the synergistic effect of pore structure and N/F bifunctional groups.