A model which takes into account both stray light and polychromatic light was used to predict and evaluate linearity in on-capillary detection in capillary electrophoresis (CE). According to the model the stray light is the major factor which determines linearity under typical CE operating conditions. By calculating theoretical absorbance versus concentration plots, the influence of different levels of stray light and polychromatic light on linearity is demonstrated. Experimentally, six light-emitting diodes (LEDs) in the range from 563 to 654 nm were examined as light sources for on-capillary detection in CE. Fitting theoretical curves to measured linearity plots enabled determination of the values of both effective path length and stray light for a particular detection system. The detector linearity for the four LEDs was compared to mercury and tungsten lamps used with interference filters. For potassium permanganate as the test compound, the linear range for a 563 nm LED was two times greater than that for a mercury lamp operated at 546 nm. The relatively poor linearity of the mercury lamp detector is explained by its high level of stray light. The noise of the LED563-based detector was the same as for the mercury lamp, whereas the other LEDs of higher light intensity gave approximately half the noise of the mercury lamp. The lowest noise level of 3 x 10(-5) AU was obtained for the LED at 554 nm (determined at a detector time constant of 0.1 s).