As post-lithium ion batteries, both sodium ion batteries (SIBs) and potassium ion batteries (PIBs) possess great potential for large scale energy storage. However, the improvements of both SIBs and KIBs for practical applications are facing great challenges in the development of high-performance electrode materials. Here, we demonstrate the fabrication of alkalized Ti3C2 (a-Ti3C2) MXene nanoribbons attained by continuous shaking treatment of pristine Ti3C2 MXene in aqueous KOH solution. Benefited from the expanded interlayer spacing of a-Ti3C2, narrow widths of nanoribbons as well as three-dimensional (3D) interconnected porous frameworks for enhanced ion reaction kinetics and improved structure stability, the resulting a-Ti3C2 anodes showed excellent sodium/potassium storage performance, for example, high reversible capacities of 168 and 136 mAh g-1 at 20 mA g-1 and 84 and 78 mAh g-1 at 200 mA g-1 were obtained for SIBs and PIBs, respectively. Notably, a-Ti3C2 possessed outstanding long-term cyclability at high current density of 200 mA g-1, delivering a capacity of ~50 mAh g-1 for SIBs and ~42 mAh g-1 for PIBs after 500 cycles, which outperformed most of reported MXene based anodes for SIBs and PIBs. Therefore, this alkalization strategy for the synthesis of 3D MXene frameworks could be extended as a universal approach for fabricating various alkalized MXene-based materials derived from a large family of MAX phases for numerous applications, such as catalysis, energy storage and conversion.