Herein, the first-principles computations are utilized to study the optoelectronic properties, photovoltaic performance, crystal stability, and mechanical features of Ba3MX3 (M = As, Sb; X = Cl, Br, I). Through comprehensive structural stability evaluation, all compounds are determined to be stable. The results indicate that Ba3MX3 (M = As, Sb; X = Cl, Br) is brittle while both Ba3AsI3 and Ba3SbI3 are ductile. The HSE06-based electronic structure calculations show that the direct-gap nature is revealed for six compounds, and the energy band gaps are within the range of 1.35–1.65 eV. The fundamental band gap can be modulated by virtue of X-anion substitution. The low carrier effective masses are disclosed for these compounds. Their optical features exhibit that high solar absorption and weak reflectance and energy loss are observed. Ultimately, an ultra-high theoretical conversion efficiency of 31.9 % is implemented for Ba3MI3 (M = As, Sb). Besides, the remaining four compounds also have high conversion efficiencies within 29–30 %. From the suitability for practical applications, both Ba3AsI3 and Ba3SbI3 are chosen as the best candidates for the absorber layers of effective single-junction solar cells. Our findings unveil the suitability of these inorganic materials for optoelectronic applications.