Famotidine 40 mg is a prescription-strength acid reducer used to treat active stomach ulcers, active duodenal ulcers, and more severe cases of gastroesophageal reflux disease (GERD), particularly when the esophagus has been damaged by acid. It’s the higher-dose form of the same medication sold over the counter at 20 mg under the brand name Pepcid, and it’s typically taken once daily at bedtime for a set number of weeks.
How Famotidine Reduces Stomach Acid
After you eat, your body releases a chemical called histamine that binds to specific receptors on the cells lining your stomach. That binding triggers those cells to pump out acid. Famotidine works by attaching to those same receptors first, essentially blocking histamine from landing. With histamine locked out, your stomach produces significantly less acid.
A single 40 mg dose starts working within one hour, reaches its peak effect between one and three hours, and keeps acid suppression going for 10 to 12 hours. That long window is why the standard instruction for ulcers is one pill at bedtime: it suppresses acid through the overnight hours when your stomach would otherwise be bathing a healing ulcer in digestive juices.
Stomach and Duodenal Ulcers
The primary use for famotidine 40 mg is healing active ulcers in the stomach or the duodenum (the first section of the small intestine, just past the stomach). For both types, the recommended dose is 40 mg once daily at bedtime, taken for up to eight weeks. In clinical trials, most patients with duodenal ulcers healed within four weeks. Those who didn’t were typically given an additional two to four weeks.
Once an ulcer has healed, some people continue on a lower 20 mg dose at bedtime as maintenance therapy to prevent it from coming back. The 40 mg dose is reserved for the active healing phase.
GERD and Erosive Esophagitis
When stomach acid repeatedly washes up into the esophagus, it can cause inflammation, erosions, and even small ulcerations in the esophageal lining. This condition, called erosive esophagitis, is a more severe form of GERD. Famotidine 40 mg is approved for treating it, either as 40 mg once daily at bedtime or 20 mg taken twice a day (morning and bedtime), for up to 12 weeks.
For milder GERD without visible damage to the esophagus, lower doses often do the job. The American Gastroenterological Association notes that while proton pump inhibitors (like omeprazole) are more effective than famotidine for healing esophagitis and controlling GERD symptoms, famotidine still works significantly better than a placebo. It’s a reasonable option for people who prefer to avoid PPIs or who experience side effects from them, and it’s commonly used for short courses or as-needed symptom control.
Conditions That Cause Excess Acid Production
Rare conditions like Zollinger-Ellison syndrome cause the stomach to produce extreme amounts of acid, far beyond what normal heartburn involves. Famotidine can be used in these cases, though the doses climb much higher than 40 mg. Patients with Zollinger-Ellison syndrome have tolerated doses up to 800 mg daily. Treatment for these conditions is closely managed and individualized.
Prescription vs. Over-the-Counter Strength
The famotidine you can buy without a prescription comes in 10 mg and 20 mg tablets, intended for occasional heartburn relief. The 40 mg tablet is typically prescription-only because it’s meant for diagnosed conditions that need a longer, more structured treatment course. If you’re taking 40 mg, it was likely prescribed for a specific problem with a defined duration, not for occasional use after a heavy meal.
The difference matters practically. Over-the-counter famotidine is designed for short-term, self-directed use. Prescription 40 mg courses run four to twelve weeks depending on the condition, and your doctor will likely want to reassess whether you still need it once that window closes.
Side Effects at 40 mg
Famotidine is well tolerated overall. The most commonly reported side effects are mild: headache, dizziness, constipation, and diarrhea. These tend to resolve on their own and don’t affect most people.
Serious reactions are uncommon but worth knowing about. Hives, skin rash, swelling of the face or throat, and difficulty breathing or swallowing are signs of an allergic reaction that needs immediate attention. These reactions are rare at any dose, and the 40 mg strength doesn’t carry a meaningfully different risk profile than lower doses for most people.
What to Expect During Treatment
If you’re taking famotidine 40 mg for an ulcer, you can expect symptom relief (less pain, less burning) within the first few days, though the ulcer itself takes weeks to fully heal. Most people notice a clear improvement within two weeks. The full course matters even if you feel better early, because an ulcer that looks healed on the surface may still be repairing deeper tissue.
For GERD with esophagitis, the 12-week treatment window reflects how long esophageal tissue takes to repair. You’ll likely feel better well before that, but the tissue damage lags behind symptom relief. Stopping early increases the chance of symptoms returning quickly.
Taking the dose at bedtime isn’t arbitrary. Stomach acid production naturally peaks during the night, and suppressing that overnight surge gives damaged tissue its best opportunity to heal while you sleep.

