Transcranial magnetic stimulation (TMS) is a diagnostic and therapeutic modality that is being developed as both an acute and preventive treatment for migraine. TMS delivers a fluctuating magnetic field from the scalp surface to induce current in the subjacent cortex. Magnetic pulses are delivered one at a time in single-pulse TMS (sTMS) or as a train of pulses in repetitive TMS (rTMS). For most of its 30-year history, TMS has been delivered in clinical and research settings using large tabletop devices. Based on the theory that sTMS may disrupt cortical spreading depression, sTMS has been studied and shown to be effective as an acute treatment for migraine with aura. Subsequent work in animal models confirms that sTMS disrupts cortical spreading depression. To make outpatient self-treatment possible, a portable device has been developed for acute treatment of migraine with aura. Based on the theory that rTMS alters brain excitability and neurotransmitter activity, rTMS has been studied as a preventive migraine treatment. A small body of evidence suggests that rTMS may have a role, but further studies are needed.