A layered potassium vanadate K0.23V2O5 has been successfully prepared by the hydrothermal method and evaluated as an anode material for lithium-ion and potassium-ion batteries. High structural stability is demonstrated by the ex situ X-ray diffraction (XRD) and ex situ scanning electron microscopy (SEM). When used as an anode material for lithium-ion batteries, the K0.23V2O5 exhibits a reversible capacity of 480.4 mAh g−1 at 20 mA g−1 after 100 cycles and 439.7 mAh g−1 at 200 mA g−1 after 300 cycles as well as good cycling stability. Even at a high current density of 800 mA g−1, a high reversible capacity of 202.5 mAh g−1 can be retained, indicating excellent rate performance. Whereas in potassium-ion batteries, it retains a capacity of 121.6 mAh g−1 after 150 cycles at 20 mA g−1 and 97.6 mAh g−1 at 100 mA g−1 after 100 cycles. Such superior electrochemical performance of K0.23V2O5 can be ascribed to the special flower-like morphology and structure. Overall, the results highlight the great potential of K0.23V2O5 as an anode material for both lithium-ion and potassium-ion batteries.