A novel air-stable titanium hexacyanoferrate (Ti0.75Fe0.25[Fe(CN)6]0.96·1.9H2O) with a cubic structure is synthesized simply by a solution precipitation method, which is first demonstrated to be a scalable, low-cost anode material for lithium-ion batteries exhibiting high capacity, long cycle life and good rate capability. Nevertheless, it has a low capacity of about 100 mAh g−1 as an anode material for sodium-ion batteries.