Abstract Polyaniline nanofibers (PANI-NF) were first synthesized with diameters of approximately 60–80 nm. PANI-NF/gold nanoparticle (PANI-NF/AuNP) nanocomposite was then fabricated through a simple electrostatic reaction between the positive charges on the surface of PANI-NF and the negatively charged AuNPs. Thereafter, a novel electrochemical cytosensor was designed by the self-assembly of folate on PANI-NF/AuNP nanocomposite film. An electrochemical impedance method was used to detect cancer cells based on the specific interaction between the folate receptor on cancer cell membranes and folate immobilized on PANI-NF/AuNP surface. Experimental results showed that the PANI-NF/AuNP cytosensor specifically recognized cancer cells, such as HeLa cells, which was reflected by the change in electrode impedance after attachment of the cancer cells. The linear detection range was from 1.0 × 104 to 6.4 × 106 cells mL−1, and the detection limit was 2000 cells mL−1. This cytosensor has several advantages, such as easy construction, short response time, high sensitivity, easy regeneration, good stability, and freedom of additional labeling, which can be thus used for a highly sensitive detection of cancer cells.