Using 2-amino-4-(4-nitrophenyl) diazenyl) pyridine-3-ol (ANPDP) as a reagent, a sensitive and selective surfactant-assisted spectrophotometric method for the rapid determination of copper (II) and mercury (II) was proposed. When the ANPDP reagent reacts with both Cu(II) and Hg(II) ions in a universal buffer solution containing sodium dodecyl sulfate, it produces a violet color. Cu(II) and Hg(II) had the highest absorbance at 565 and 605 nm, respectively. The complexes of Cu(II) and Hg(II) have a mole ratio of 1:2 [M:L]. Cu(II) and Hg(II) have linear ranges of 10-180 and 10-160 g mL1, respectively, with detection limits of 1.36 and 1.74 g mL1 and quantification limits of 4.1 and 5.26 g mL1. The complex's correlation coefficients of 0.994 and 0.995, respectively, show high linearity. Cu(II) and Hg(II) relative standard deviations for six replication measurements were 1.01% and 1.2%, respectively. The analytical parameters for the procedure were optimized. Most other metals and rather high concentrations of co-existing elements can be tolerated. This method has the benefits of being quick, easy, sensitive, and selective, and it was successfully used to determine the presence of Cu(II) and Hg(II) ions in real samples, and recovery percentage was found to be 95.0-98.0 %.