A novel composite film modified electrode was prepared by combining the strong electrostatic adsorption ability of positively quaternized carbon nanotubes (q-CNTs) and excellent electroactivity of ionic liquid (1-methylimidazolium trifluoroacetate) doped polyaniline (IL-PANI) for the determination of ascorbic acid (AA). The q-CNTs/IL-PANI/GCE was characterized by cyclic voltammetry, FT-IR spectroscopy, electrochemical impedance spectroscopy (EIS) and scanning electron microscopy (SEM). The IL-PANI film with uniform morphology showed good conductivity and electrochemical activity even in neutral solutions, this make it perfect as a matrix for the uniform dispersion of q-CNTs. Moreover, the electrostatic interaction between the q-CNTs and the doped CF 3 COO − anions of IL-PANI film led to form a stable q-CNTs/IL-PANI composite film on GCE. The q-CNTs/IL-PANI/GCE exhibited excellent electrocatalytic oxidation activity toward ascorbic acid and was successfully used for the determination of AA by amperometry at +0.05 V under pH 7.0. The amperometric current was increased linearly with AA concentration from 20 nM to 4 μM, and the detection limit was 0.25 nM (S/N = 3). The analysis of beverage and urine real samples was performed and the obtained results were satisfactory. The q-CNTs/IL-PANI composite film modified electrode provided a novel electrochemical sensor with high sensitivity and stability for the determination of AA.