Ni–B coatings have been deposited directly on commercial purity magnesium and AZ91D alloy and characterized using glow discharge optical emission spectroscopy, scanning electron microscopy, X-ray diffraction and, for tribological and mechanical evaluation, dry sliding wear and friction testing and microhardness measurement. The boron content of the coating on Mg was slightly lower than that of the coating on the AZ91D alloy. The wear rates were similar for both coatings and two magnitude orders lower than those of the substrates. The coefficients of friction were similar for both coatings, in the range ∼0.31 to 0.34. The values were close to that of the uncoated magnesium, while that for the AZ91D alloy was slightly lower, namely ∼0.25. The wear mechanism of the electroless Ni–B coatings was governed by the presence of abrasive wear, delamination and tribo-corrosion processes.