AbstractThe thermal treatment of the CdTe thin film in the presence of CdCl2 is a crucial step in the creation of high-efficiency CdTe-based solar cells. The process influences the grain growth, grain boundary passivation, and doping, including CdTe recrystallization, and promotes to building of the photovoltaic junction. However, toxic Cd2+ ions released by the CdCl2, which is highly soluble in water is a major environmental concern of this process. Also, the price of CdCl2 (about 30 cents/gram) that drives up manufacturing costs is another limitation of the current processs. Finding a non-toxic Cl molecule is therefore currently in high demand and key factor for the thermal treatment of CdTe. In this study, MgCl2 was thoroughly explored as an alternative, non-toxic, and somewhat less expensive chlorine-containing chemical for CdTe thermal treatment. CdTe thin films, approximately 1.0 µm thick, were deposited on a glass substrate at 350 ºC using RF magnetron sputtering, and after deposition, different concentrations of MgCl2 (0.2 M, 0.3 M, 0.4 M, and 0.5 M) mixed with 10% methanol were applied to the films for around 10 s, forming a thin MgCl2 coating, followed by the optimized heat treatment at 400 ºC in a nitrogen–oxygen environment. We found that the thermal treatment of CdTe films using MgCl2 showed improved crystallinity, surface morphology, impurity profiles, and carrier density similar to the conventional CdCl2 process. The sample treated with 0.4 M MgCl2 exhibited the best output as obtained the band gap of nearly 1.46 eV, a refractive index of 2.84, a carrier concentration of 9.81E+15 cm−3, and mobility 35.08 cm2/V-S with a moderate resistivity. Our findings show that MgCl2 could be utilized instead of traditional CdCl2 in the current fabrication procedure, which substantially lowers the environmental hazard with a cost-effective production process of CdTe-assembled solar cells.