Lithium-ion and sodium-ion batteries (LIBs and SIBs) are crucial in our shift toward sustainable technologies. In this work, the potential of layered boride materials (MoAlB and Mo2AlB2) as novel, high-performance electrode materials for LIBs and SIBs, is explored. It is discovered that Mo2AlB2 shows a higher specific capacity than MoAlB when used as an electrode material for LIBs, with a specific capacity of 593 mAh g−1 achieved after 500 cycles at 200 mA g−1. It is also found that surface redox reactions are responsible for Li storage in Mo2AlB2, instead of intercalation or conversion. Moreover, the sodium hydroxide treatment of MoAlB leads to a porous morphology and higher specific capacities exceeding that of pristine MoAlB. When tested in SIBs, Mo2AlB2 exhibits a specific capacity of 150 mAh g−1 at 20 mA g−1. These findings suggest that layered borides have potential as electrode materials for both LIBs and SIBs, and highlight the importance of surface redox reactions in Li storage mechanisms.