Doctors Note Logo

Published on: 9/15/2026

Is stomach pain for weeks a sign of stomach cancer or an ulcer?

Persistent stomach pain lasting weeks is far more often caused by a peptic ulcer, gastritis, acid reflux, H. pylori infection, or IBS than by stomach cancer, which is rare and usually appears with additional warning signs. Ulcer pain tends to be burning or gnawing in the upper abdomen and may change with meals, while cancer is more often suggested by unexplained weight loss, difficulty swallowing, vomiting, black or bloody stools, early fullness, or persistent fatigue and anemia. Because both conditions share overlapping symptoms and only testing such as endoscopy, H. pylori screening, or imaging can tell them apart, there are several important factors to consider below before assuming the cause. Pain that continues for more than two weeks, worsens, or comes with any red flag symptom deserves prompt medical evaluation rather than continued self treatment with antacids.

Since timing, symptom pattern, and personal risk factors change how urgently you should be seen, a free, instant, online symptom check can help you organize what you are experiencing and understand the most likely explanations and sensible next steps.

Last reviewed for medical accuracy: 09/14/2026

answer background

Explanation

Understanding Persistent Stomach Pain: Ulcer or Cancer?

Stomach pain is a symptom many people experience at some point. When that pain lasts for weeks, it’s natural to worry about serious conditions like stomach cancer or an ulcer. While both can cause discomfort, stomach cancer is much less common than ulcers or other digestive issues. This guide helps you understand possible causes, warning signs, and next steps—without unnecessary alarm.

Common Causes of Weeks-Long Stomach Pain

Persistent stomach pain often stems from non-cancerous issues, including:

  • Gastritis (inflamed stomach lining)
  • Peptic ulcers (sores in the stomach or upper small intestine)
  • Acid reflux or GERD (gastroesophageal reflux disease)
  • Irritable bowel syndrome (IBS)
  • Food intolerances or sensitivities
  • Stress or lifestyle factors (poor diet, smoking, alcohol)

While these are far more likely than cancer, ongoing pain always warrants investigation.

Peptic Ulcers: What You Need to Know

Peptic ulcers are open sores that develop on the lining of the stomach or the first part of the small intestine. They often cause burning or gnawing pain.

Causes and Risk Factors

  • Helicobacter pylori (H. pylori) infection
  • Regular use of non-steroidal anti-inflammatory drugs (NSAIDs), such as ibuprofen
  • Smoking
  • Excessive alcohol use
  • Stress (can worsen symptoms, though not a direct cause)

Typical Symptoms

  • Burning or aching pain between meals or at night
  • Bloating, belching, heartburn
  • Nausea or occasional vomiting
  • Loss of appetite, weight loss

Most ulcers respond well to treatment with medications that reduce stomach acid and, if needed, antibiotics to clear H. pylori.

Stomach (Gastric) Cancer: What to Watch For

Stomach cancer develops when abnormal cells grow in the stomach lining. It’s much less common than ulcers, especially in younger people.

Risk Factors

  • Long-term H. pylori infection
  • Smoking
  • Excessive salt intake, smoked or pickled foods
  • Family history of gastric cancer
  • Chronic gastritis or certain genetic conditions

Possible Symptoms

  • Persistent stomach pain or discomfort
  • Unintentional weight loss
  • Feeling full quickly when eating
  • Difficulty swallowing (dysphagia)
  • Nausea or vomiting, sometimes with blood
  • Dark, tarry stools (indicating bleeding)

Because early stomach cancer often has no symptoms or only vague discomfort, it’s frequently diagnosed at a later stage. That’s why it’s crucial to pay attention to any “alarm” signs.

Comparing Ulcer and Cancer Symptoms

Symptom Peptic Ulcer Stomach Cancer
Stomach pain Burning, relieved by eating or antacids Constant or progressive, not relieved
Appetite changes Possible decrease due to pain Often sharp decrease
Weight loss Mild or none Noticeable, unintentional
Nausea/vomiting Occasional May be persistent or severe
Vomiting blood Possible but less common More concerning
Stool changes Rarely causes bleeding Black, tarry stools
Feeling full quickly Uncommon Common

This table highlights trends, not absolutes. Only a medical evaluation can provide a clear diagnosis.

When to Seek Medical Attention

If you experience any of the following “alarm symptoms,” schedule an appointment promptly:

  • Severe or worsening stomach pain
  • Blood in vomit or stool (bright red blood or black, tarry stools)
  • Unexplained weight loss
  • Persistent nausea or vomiting
  • Difficulty swallowing
  • Signs of anemia (fatigue, pale skin, shortness of breath)

Even if your symptoms seem mild, don’t ignore stomach pain that lasts more than two weeks. Early evaluation improves outcomes, whether it’s an ulcer that requires treatment or a more serious condition.

Diagnosis: What to Expect

A healthcare professional may recommend:

  1. Medical history and physical exam
  2. Test for H. pylori infection (breath, blood, stool tests)
  3. Blood tests (check for anemia, infection)
  4. Upper endoscopy (a thin tube with a camera to view the stomach lining)
  5. Biopsy (tiny tissue sample taken during endoscopy)
  6. Imaging tests (CT scan, ultrasound)

These tests help distinguish between ulcers, gastritis, cancer, and other digestive disorders.

Treatment Options

For Peptic Ulcers

  • Proton pump inhibitors (PPIs) or H2 blockers to reduce acid
  • Antibiotics if H. pylori is present
  • Lifestyle changes (avoid NSAIDs, reduce alcohol, quit smoking)
  • Dietary adjustments (eat smaller, balanced meals; limit spicy or fatty foods)

Most people heal fully with proper treatment and follow-up.

For Stomach Cancer

  • Surgery (removal of part or all of the stomach)
  • Chemotherapy or radiation therapy
  • Targeted therapies or immunotherapy in select cases
  • Nutritional support (small, frequent meals; supplements)

Early-stage cancer has better treatment outcomes. Advanced cases may require combined approaches to control symptoms and improve quality of life.

Managing Anxiety and Next Steps

It’s natural to worry about persistent stomach pain. However, remember:

  • Ulcers and gastritis are much more common and treatable.
  • Serious conditions are rare, especially in younger, healthy individuals.
  • Seeking medical advice early helps rule out or treat any problem effectively.

You might also consider doing a free, online symptom check, using the doctor approved Ubie Symptom Checker to help you sort through your symptoms and decide on next steps.

Final Thoughts and Recommendations

Persistent stomach pain shouldn’t be ignored. While most cases turn out to be ulcers or benign digestive issues, the possibility of gastritis or, rarely, stomach cancer makes professional evaluation key.

  • Track your symptoms: note timing, triggers, severity
  • Share your medical history, including any family history of digestive diseases
  • Follow through on recommended tests and follow-up visits
  • Discuss treatment options and lifestyle changes with your doctor

Most importantly, if you have any warning signs—such as bleeding, weight loss, or severe pain—speak to a doctor right away. Early diagnosis and treatment lead to the best outcomes.

(References)

  • * Flasar MH, Goldberg E. Acute abdominal pain. Med Clin North Am. 2006 May;90(3):481-503. doi: 10.1016/j.mcna.2005.11.005. PMID: 16473101.

  • * Horn A, O'Neill G, Costantino TG. Pneumoperitoneum. J Emerg Med. 2011 Jun;40(6):e121-2. doi: 10.1016/j.jemermed.2008.11.020. Epub 2009 Feb 28. PMID: 19251388.

  • * Schulman AR, Tavakkoli A, Thompson CC, Miller AL, Loscalzo J. Making the Connection. N Engl J Med. 2017 Feb 2;376(5):476-482. doi: 10.1056/NEJMcps1602495. PMID: 28146669.

  • * Hána L, Ryska M. Acute abdomen in drug abusers. Rozhl Chir. 2019 Winter;98(1):14-17. PMID: 30781961.

  • * Qi X, Guo X, Shao X. Double pylorus. Dig Liver Dis. 2019 Dec;51(12):1739. doi: 10.1016/j.dld.2019.09.007. Epub 2019 Oct 11. PMID: 31611154.

  • * Bartolo AD, Sircar S, Mitchell R. Post-partum duodenal perforation. N Z Med J. 2020 Jun 12;133(1516):97-99. Epub 2020 Jun 12. PMID: 32525866.

  • * Lax Y, Singh A. Referred Abdominal Pain. Pediatr Rev. 2020 Aug;41(8):430-433. doi: 10.1542/pir.2019-0221. PMID: 32737258.

  • * Demir M, Akın M, Yücel N, Unal A, Gürel D, Yaşa E. Role of Radiology and Laparoscopy in Childhood Peptic Ulcer Perforation. J Environ Public Health. 2022;2022:1211499. doi: 10.1155/2022/1211499. Epub 2022 Jul 20. PMID: 35910757; PMCID: PMC9328947.

  • * Corazziari ES, Gasbarrini A, D'Alba L, D'Ovidio V, Riggio O, Passaretti S, Annibale B, Cicala M, Repici A, Bassotti G, Ciacci C, Di Sabatino A, Neri M, Bragazzi MC, Ribichini E, Radocchia G, Iovino P, Marazzato M, Schippa S, Badiali D. Poliprotect vs Omeprazole in the Relief of Heartburn, Epigastric Pain, and Burning in Patients Without Erosive Esophagitis and Gastroduodenal Lesions: A Randomized, Controlled Trial. Am J Gastroenterol. 2023 Nov 1;118(11):2014-2024. doi: 10.14309/ajg.0000000000002360. Epub 2023 Jun 13. PMID: 37307528; PMCID: PMC10617666.

  • * Vakil N. Peptic Ulcer Disease: A Review. JAMA. 2024 Dec 3;332(21):1832-1842. doi: 10.1001/jama.2024.19094. PMID: 39466269.

Thinking about asking ChatGPT?Ask me instead

Tell your friends about us.

We would love to help them too.

smily Shiba-inu looking

For First Time Users

What is Ubie’s Doctor’s Note?

We provide a database of explanations from real doctors on a range of medical topics. Get started by exploring our library of questions and topics you want to learn more about.

Was this page helpful?

Purpose and positioning of servicesUbie Doctor's Note is a service for informational purposes. The provision of information by physicians, medical professionals, etc. is not a medical treatment. If medical treatment is required, please consult your doctor or medical institution. We strive to provide reliable and accurate information, but we do not guarantee the completeness of the content. If you find any errors in the information, please contact us.