In this work, a new electrochemical sensor based on molecular imprinting was developed by electrochemical polymerization of p-aminobenzenesulphonic acid (ABSA) on a pencil graphite electrode modified with carbon nanodots (CNDs) for detection of folic acid (FA) selectively and sensitively. The detection of FA is crucial since the deficiency of FA causes many diseases in humans and due to its antioxidant property, FA prevents the free radical attacks on DNA. CNDs were synthesized electrochemically by applying a constant potential to the two graphite pencil rods, and characterized by TEM, UV-visible and fluorescence measurements. CNDs were utilized to improve the electrochemical signal enlarging the rate of electron-transfer, electroactive surface area and intensity of the sensor. Folic acid imprinted (FA-imp) and non-imprinted (N-imp) electropolymerized films on electrodes were characterized by SEM, optical profilometry and voltammetry measurements. The electropolymerization of ABSA and optimizations of experimental steps were conducted by cyclic voltammetry and differential pulse voltammetry. The increase in reduction peak current was proportional to the concentration of FA in the range of 2.2-30.8 ng/mL and the limit of detection was calculated as 2.02 ng/mL. The proposed sensor with long term stability and satisfactory reproducibility was effectively implemented for selective and sensitive detection of FA in pharmaceutical and human urine samples.