High-temperature superconductors have created the opportunity for a step change in the technology of power applications. Racetrack superconducting coils made from YBCO coated conductors have been used in several engineering applications including SMES, rotor or stator windings of electric machines. AC loss is one of the most important factors that determine the design and performance of superconducting devices. In this paper, a numerical model is developed to calculate the AC losses in superconducting racetrack coils in different magnetic conditions. This paper first discusses the AC losses of the coils in self-field or external field only. It then goes to investigate the AC losses of the coils being exposed to AC ripple field and a DC background field. Finally, the AC losses of the coils carrying DC current and being exposed to AC field are calculated. These two scenarios correspond to using superconducting coils as the rotor field winding of an electric machine.