The structural, stability, mechanical, elastic anisotropy and electronic properties of two ternary light element compounds, B 2CO 2 and B 6C 2O 5, are systematically investigated. The elastic constants and phonon calculations reveal that B 2CO 2 and B 6C 2O 5 are both mechanically and dynamically stable at ambient pressure, and they can stably exist to a pressure of 20 GPa. Additionally, it is found that B 2CO 2 and B 6C 2O 5 are wide-gap semiconductor materials with indirect energy gaps of 5.66 and 5.24 eV, respectively. The hardness calculations using the Lyakhov-Oganov model show that B 2CO 2 is a potential superhard material. Furthermore, the hardness of B 6C 2O 5 is 29.6 GPa, which is relatively softer and more easily machinable compared to the B 2CO 2 (41.7 GPa). The elastic anisotropy results show that B 6C 2O 5 exhibits a greater anisotropy in the shear modulus, while B 2CO 2 exhibits a greater anisotropy in Young’s modulus at ambient pressure.