Abstract
A sustainable UV-spectrophotometric method coupled with bio-inspired chemometric algorithms was developed for simultaneous quantification of three COVID-19 antivirals — molnupiravir, nirmatrelvir, and favipiravir — addressing severe spectral overlap challenges. Genetic algorithm-partial least squares (GA-PLS) and firefly algorithm-partial least squares (FFA-PLS) were comparatively evaluated for wavelength selection optimization using a calibration set of 25 mixtures spanning 4–12 µg/mL for favipiravir and molnupiravir, and 8–24 µg/mL for nirmatrelvir, with FFA-PLS demonstrating advantages in model simplicity and predictive accuracy (R² > 0.996, RMSEP < 3.0). An independent 20-mixture validation set was constructed using central composite design to evaluate model predictive capability. Subsequently, ICH Q2(R2) validation confirmed method reliability with acceptable accuracy (recoveries 96.74–102.85%), precision (RSD < 2.1%), and selectivity against pharmaceutical excipients and environmental interferents. Furthermore, the validated method was successfully applied to commercial pharmaceutical formulations with statistical equivalence to a reported HPLC method (p > 0.05), and to spiked tap water samples with recoveries of 95.33–104.45%. Comprehensive sustainability assessment using four complementary metrics (MoGAPI: 72/100, CaFRI: 85/100, BAGI: 77.5/100, RGB12: 86.5/100) confirmed the method as environmentally friendly and practically implementable, offering a cost-effective alternative to chromatographic techniques for pharmaceutical quality control and environmental monitoring. SUPPLEMENTARY INFORMATION: The online version contains supplementary material available at 10.1038/s41598-026-49288-3.