Shortwave ultraviolet light (UV-C) and ultraviolet light-emitting diodes (UV-LEDs) are emergent technologies to inactivate pathogenic and spoilage microorganisms in food. However, the effectiveness of these technologies is influenced by the optical properties of the treated food. This work aimed to evaluate the effect of the optical properties of nine model food solutions on the efficacy of UV-C (at 255 nm) and UV-LEDs (at 255, 265 or 280 nm) to inactivate E. coli ATCC 25922. Model solutions were formulated with saccharose (SC), tartrazine (TT) and xanthan gum (XG), exposed from 0 to 50 min. The microbial population was reduced after 15 min of UV-C and UV-LED treatment by >6 log CFU/mL for water and TT, and by UV-C for SC, XG, TT + SC, and (XG + TT + SC) m solutions. The inactivation data were correlated using three different models. Colored compound (TT) showed 60% degradation by UV-C compared to 3% by UV-LED at 50 min.Industrial relevance: Non-thermal treatments such as those based on ultraviolet light, UV-C, and UV-LEDs could have high industrial relevance because of their simplicity of operation and reduced by-product formation, being a friendly alternative for food processing. Understanding the effect of different optical and physicochemical properties of liquid food to be treated by UV-based technologies is mandatory for the equipment's efficient design and operation. Furthermore, the proper selection of processing conditions, such as delivered dose and processing time, allows for obtaining safe and high-quality products.