Recently, MoO2 has been widely studied as an anode material owing to its high theoretical capacity and stability. In this study, nano-sized MoO2 is successfully fabricated on three-dimensional porous carbon (3DPC) using a simple hydrothermal method followed by calcination. The composite exhibits higher surface area (171.6 m2 g−1) than that of bulk MoO2 (81.4 m2 g−1). For the first time, the novel MoO2/3DPC composite is tested in both sodium and potassium ion batteries. The MoO2/3DPC composite exhibits improved electrochemical performance than that of bulk MoO2 powder. In Na+ half cells, the specific charge capacity in the first cycle of the MoO2/3DPC composite at 0.1 A g−1 is ∼463 mAh g−1 and a reversible capacity of ∼367 mAh g−1 can be maintained after 200 cycles. In K+ half cells, the initial charge capacity is ∼350 mAh g−1 at 0.05 A g−1. In addition, a reversible charge capacity of as high as 213 mAh g−1 can be maintained after 200 cycles. The synergistic effect of 3DPC and nano-sized MoO2 improves the electrochemical performance. The unique 3D structure of porous carbon can increase the electrical conductivity and alleviate the absolute stress/strain. Results demonstrate that the MoO2/3DPC composite is one of the promising candidates for Na+/K+ storage.