Nickel–tin foams with a graded micro-porous framework and nano-porous walls are created by an electrochemical deposition method for use as the anode in rechargeable lithium batteries. The resulting electrodes react readily with lithium electrochemically and deliver a reversible capacity of more than 470mAhg−1 for up to 50 cycles. In addition, they show outstanding rate performance: their reversible capacity at a discharging rate of 20C is about 70% of the capacity at a rate of 1C, due mainly to their unique structure which allows facile lithium-ion transport and fast surface reactions. The reversible capacity and rate capability show strong dependence on the thickness of the deposit and this is associated with the accessibility of lithium ions inside the porous structure.