High coercivity Nd–Fe–B films with c-axis texture perpendicular to the film plane have been prepared by dc magnetron sputtering and subsequent heat treatment. The influences of heat treatment and buffer layer materials (Mo and Ti) on the microstructure and magnetic properties of the Nd–Fe–B films are investigated. For the film with Mo buffer layer, when the substrate temperatures (Ts) are below the crystallization temperature (Tcr), the as-deposited films are identified to be soft magnetic with a mazelike stripe magnetic domain structure. After subsequent heat treatment, Nd2Fe14B phase forms with c-axis texture perpendicular to the film plane, and the domain structure is not mazelike anymore. The coercivity of the annealed films increases with decreasing Ts and the highest coercivity of about 22.8 kOe has been achieved. For the film with Ti buffer layer, the heat treatment also results in changing the magnetic domain structures from a mazelike pattern to a disordered pattern. Atomic force microscopic observation shows that some ridgelike areas exist in the annealed film with Ti buffer layer.