Accurate and reliable determination of synthetic dyes in foodstuff is very important to underpin their regulation so as to prevent harm to consumers. Herein, a poly(L-phenylalanine)-modified glassy carbon electrode (PLPA/GCE) for the determination of sunset yellow (SY) and tartrazine (Tz) was fabricated through electrochemical immobilization. The electrochemical behavior of SY and Tz at the PLPA/GCE was studied by cyclic voltammetry in phosphate-citrate buffer, and the results showed that the reaction of SY and Tz at the PLPA/GCE was greatly facilitated. This was further used to determine the two species by differential pulse voltammetry. Under optimized analytical conditions, the reduction peak current of SY showed a linear relationship with its concentration in a range of 181-6,333 mu g L-1 and the oxidation peak current of Tz showed a linear relationship with its concentration in a range of 214-88,169 mu g L-1. The limits of detection for SY and Tz were 18.1 and 10.7 mu g L-1, respectively. The proposed method shows excellent sensitivity, selectivity, and accuracy and has been satisfactorily applied for the determination of SY and Tz in a variety of real food and drug samples.