The UV‐absorption spectra of cyclo‐1,3,5‐trimethylene‐2,4,6‐trinitramine (RDX) and cyclo‐1,3,5,7‐tetramethylene‐2,4,6,8‐tetranitra mine (HMX) are strongly overlapping and do not allow their direct determination without previous separation by conventional methods. A partial least squares method (PLS) in a multicomponent analysis provides a sensitive and accurate technique for the analysis of complex mixtures with strong overlapping spectra. The experimental calibration matrix was designed with 15 samples. The concentration varied between 0.584 μg/ml and 10.220 μg/ml for HMX, and between 0.400 μg/ml and 8.000 μg/ml for RDX. The cross‐validation method was used to select the number of factors. To check the accuracy of the proposed method, the optimized model obtained by using PLS‐2 was applied to the determination of these compounds in industrial samples.