The theoretical inhibitive effect of 6-phenyl-5H-benzo[a]phenothiazin-5-one, 6-phenyl-5H-benzo[a]phenoxazin-5-one and 6-(2-phenylethynyl)- 5H-benzo[a]phenoxazin-5-one compounds on mild steel in hydrochloric acid solution was described. Compounds 6-phenyl-5H-benzo[ a]phenothiazin-5-one and 6-phenyl-5H-benzo[a]phenoxazin-5-one were obtained as brilliantly reddish and yellowish powdered solids via palladium catalyzed cross-coupling of phenyl boronic acid with 6-chloro-5H-benzo[a]phenothiazin-5-one, 6-chloro-5H-benzo[a]phenoxazin-5- one respectively. The reaction of ethynylbenzene with 6-chloro-5H-benzo[a]phenoxazin-5-one afforded orange coloured solid. The intense colors of these dyes and their ease of re-oxidation of Na2S2O4-reduced derivatives make them suitable as vat dyes. In addition, quantum chemical calculations based on DFT/B3LYP level confirm that the substitution of the oxygen in the hetero cyclic ring with sulphur and the bonding of an alkynyl group (triple bond) in conjugation to the aromatic ring facilitates the adsorption of the organic compound toward the metal surface with the highest inhibition efficiency obtained for 6-(2-phenylethynyl)-5H-benzo[a]phenoxazin-5-one.