With the continuous development of the global society, people's demand for lithium is increasing. Recovering valuable lithium from waste lithium-ion batteries and fly ash is essential for environmental protection and energy saving. We have developed a new imprinted capacitance deionization technology (N@Li+-IPDI), which can selectively recover lithium ion from acidic solution (pH = 2) under complex environment. The recovery capacity of N@Li+-IPDI electrode material was up to 20.26 mg/g. Separation of Li+ from Na+, K+, and Al3+ was achieved based on the size effect. Separation from Mg2+ was due to the higher hydration energy of Mg2+ (1940 kJ/mol) than Li+ (510 kJ/mol). After 5 regeneration cycles, recovery effect of N@Li+-IPDI was 93.42 % of original. Through density functional theory (DFT) modeling, bond length of Li+-O was 2.04–2.05 Å, and adsorption energy of 2H12C4-Li+ (−33.66 Kcal/mol) was the largest among the five ions. In addition, energy and structure of deprotonation process were studied, and the energy required for deprotonation was 6.33 kJ/mol, which was the reason Li+ adsorption is difficult in acidic environment. This research provides a new green ion recovery technology with excellent selectivity, high adsorption and conductivity for Li+ recovery in acid solution, to meet the challenge of growing demand for lithium.