An online dynamic pH junction method has been proposed for sensitive determination of benzoic acid (BA) and sorbic acid (SA) by capillary electrophoresis (CE). It was based on the decreased mobility of the analytes when they migrated from sample zone with low pH to background electrolytes with high pH. Under optimized conditions, the limits of detection (S/N = 3) of BA and SA were 0.03 and 0.02 mg L -1 , respectively. According to the permitted limits of BA and SA in food (GB2760), the samples can be diluted about 2,000-20,000-folds to estimate whether the contents of BA and SA are in the safety range. Beverage, vinegar and fruit jam samples were analyzed after simple dilution, and the results were satisfactory with the recoveries in the range of 91-108%. The whole analysis process needs about only 10 min, which is much faster than the method of liquid-liquid extraction followed by CE determination.