Carbon nanotubes (CNTs) are an excellent electrode material for capacitive deionization (CDI), due to their excellent electronic conductivity and outstanding chemical/physical stability. Their powder form and easy aggregation, however, have greatly limited their practical CDI performance. Aiming to address this issue, the authors report a freestanding CNT film which was fabricated by floating-catalyst chemical vapor deposition, as a binder-free electrode for CDI. By simply adjusting the pyrrole content in the precursor, the morphology of the resulting CNT film can be tuned to meet the requirements of CDI. In the presence of 2 wt.% pyrrole, the CNT film with a mesoporous structure exhibited a large specific surface area of 198 m2/g and an increased electric double-layer capacity (40 F/g), which is more than two times as large as that of the pristine CNT film. Due to these merits, the electrosorption capacity for sodium chloride (NaCl) of the CNT film electrode (11·39 mg/g) has been greatly improved compared with that of the pristine CNT film (4·52 mg/g), showing a good potential for large-scale practical CDI.