A highly porous three-dimensional Ni–Sn alloy foam is fabricated by electro-deposition accompanied by hydrogen evolution reaction. This foam can evolve into porous and dendritic metal alloy structures. These Sn-based electrodes have been evaluated for use as anodes in lithium-ion batteries. Dendritic Ni50Sn50 alloy foam exhibits high electrochemical capacity and excellent cycle stability during charge–discharge processes. The nickel in a Ni–Sn alloy does not break off during the volume expansion/contraction sequence in battery operation cycles and supports the Sn remaining on the anodes. The voids in the tube-like porous Ni–Sn morphology enhance the mass transfer of Li+ ions and act as mechanical bumpers during the charge–discharge processes.