Abstract The effects of different Ni contents and milling durations on the discharge capacities of Mg–Ni alloys were investigated. The samples were prepared by high-energy ball milling. Their structures were determined with X-ray diffraction and their discharge capacities were tested. The results showed that the nanocrystalline Mg 2Ni, amorphous MgNi and nanocrystalline Mg–Ni alloy could be obtained respectively when the Mg 2Ni, Mg 1.5Ni and MgNi powders were milled under different conditions. The discharge capacities of milled Mg–Ni alloy powder depend on their structures. The discharge capacity of the mixed structure of nanocrystalline Mg 2Ni and Mg is higher than that of nanocrystalline Mg 2Ni phase, but the capacity of amorphous MgNi phase is not as good as that of nanocrystalline Mg–Ni alloy. The milled MgNi powder showed the best discharge capacity, 500 mAh/g, when its structure is comprised of nanocrystalline Mg–Ni alloy and nanocystalline Ni.