Amorphous cobalt–boron (Co–B) with uniform nanoparticles was prepared for the first time via reduction of cobalt acetate by potassium borohydride in the water/cetyl-trimethyl-ammonium bromide/n-hexanol microemulsion system. The sample was characterized by X-ray diffraction, transmission electron microscopy, nitrogen adsorption–desorption, X-ray photoelectron spectroscopy, inductively coupled plasma, cyclic voltammetry, differential scanning calorimetry, temperature-programmed desorption, scanning electron microscopy, charge–discharge test and electrochemical impedance spectra. The results demonstrate that electrochemical activity of the as-synthesized Co–B was higher than that of the regular Co–B prepared in aqueous solution. It indicates that the homogeneous distribution and large specific surface area helped the electrochemical hydrogen storage of the as-synthesized Co–B. Furthermore, the as-synthesized Co–B even had 347mAhg−1 after 50 cycles, while the regular Co–B prepared in aqueous solution only had 254mAhg−1 after 30 cycles at a current of 100mAg−1. The better cycling performance can be ascribed to its smaller interfacial impedance between electrode and electrolyte.