This study investigates the structural, electronic, mechanical, and optical properties of the perovskites Mg3AsX3 (X = F, Cl, Br, I) using DFT and SCAPS-1D. The tolerance factor study shows that these materials are thermodynamically stable. Furthermore, the perovskites Mg3AsF3, Mg3AsCl3, Mg3AsBr3, and Mg3AsI3 exhibit direct bandgaps of 3.48, 2.06, 1.26, and 0.265 eV, respectively, confirming their semiconducting nature. The Mg3AsBr3 stands out for its ductility and excellent optical properties, such as a high dielectric constant and good conductivity, making it ideal for solar cells. Under optimal conditions, the FTO/WS2/Mg3AsBr3/Au structure demonstrated a PCE of 31.70%, with a VOC of 1.08 V, JSC of 36.03 mA/cm2, and a fill factor (FF) of 81.64%. These computational findings suggest that Mg3AsBr3-based perovskites are promising candidates for developing highly efficient, lead-free, durable, and cost-effective solar cells, offering valuable insights for their practical application in renewable energy technologies.