It was demonstrated recently that on ultrashort timescales magnetization dynamics not only exhibits precession but also nutation. Here, we investigate how nutation can contribute to spin switching, leading towards ultrafast data writing. We use analytic theory and numerical spin simulations to discuss the behavior of ferromagnets and antiferromagnets in high-frequency magnetic fields. In ferromagnets, linearly polarized fields align the magnetization perpendicular to the external field, enabling 90 • switching. For circularly polarized fields in the xy plane, the magnetization tilts to the z direction. During this tilting it rotates around the z axis, allowing 180 • switching. In antiferromagnets, external fields with frequencies higher than the nutation frequency align the order parameter parallel to the field direction, while for lower frequencies it is oriented perpendicular to the field. The switching frequency increases with the magnetic field strength, and it deviates from the Larmor frequency, making it possible to outpace precessional switching in high magnetic fields.