Yes, there are two over-the-counter (OTC) medications that are safe to take during pregnancy.
Acetaminophen. This medication may be taken for all headaches. There are also acetaminophen tablets that have caffeine. This combination has been shown to help with migraine pain. If you take acetaminophen with caffeine during pregnancy, make sure your total caffeine from all sources (including coffee) does not go beyond 200 mg per day.
Nonsteroidal anti-inflammatory drugs (NSAIDs). These OTC medications include ibuprofen and naproxen. They can be taken for migraines that don’t get better with acetaminophen, but only in the second trimester and only for 48 hours or less at a time. It’s not clear if NSAIDs are safe for a fetus during the first trimester. Taking NSAIDs during the third trimester may lead to birth defects.
Talk with your ob-gyn if you plan to take one of these medications. Also let them know if your pain continues or gets worse while taking OTC medication.