The effect of boron (B) doping on the structural and magnetic properties is studied systematically in the Hf2Co11 thin films. The modified crystal microstructure and annealing process enhanced the coercive field up to 1754 Oe. In order to obtain superior magnetic properties, the optimum doping ratios should be properly controlled attentively. To identify the structure, B-doped Hf2Co11 thin films were investigated by temperature-dependent X-ray diffraction analysis for the first time. The hard magnetic phase of Hf2Co11 B (x) thin films was formed to orthorhombic phase with some Co impurities and had a crystallization temperature around 823 K.