© 2016 The Royal Society of Chemistry. Cobalt nanowires (NWs) have been synthesized by electrodeposition inside the pores of anodized aluminium oxide templates, at different values of applied deposition potential. The as-deposited NWs are parallel to one another and exhibit a high geometrical aspect ratio. The crystal structure of these NWs shows a strong dependence on the applied deposition potential during synthesis. X-ray diffraction indicates the predominance of hexagonal-closed-packed (HCP) phase with (002) texture at low applied deposition potentials, whereas a reorientation of the c-axis of the HCP structure is observed for high electrodeposition potentials. Moreover, for a given electrodeposition time, the length of the NWs also increases with the applied potential. As a result of these structural changes, a switch in the magnetic easy axis, from parallel to perpendicular to the NW axis, occurs depending on the applied potential. A simplified model is used to account for this reorientation of the effective magnetic anisotropy direction, which takes into account the interplay between shape anisotropy, magnetocrystalline anisotropy and interwire dipolar interactions.