A high coercivity and a high hysteresis loop squareness pure Co and Co‐Ni (up to 50 at %) alloy films have been prepared by a new process. The new process involves the films, including N, being sputter deposited in an atmosphere of Ar‐N2mixture and annealed at temperature above 553 K. Most of the included N diffuses out from the film surface after annealing, and the films have a strong preferred orientation with thecaxis parallel to the film plane. In Co70Ni30alloy films, a high coercivityHcof 1 kOe (80 kA/m) and a high hysteresis loop squarenessS* of 0.95 are achieved. The values ofHcgradually decrease as the Ni/Co concentration ratio of the films departs from 30/70. There is a strong correlation betweenHcand the preferred orientation of crystallites;Hcincreases as thecaxis orientation parallel to the film plane grows.