Medical expert of the article
New publications
Stomach cramps: what they are and how they manifest
Last updated: 27.10.2025
All iLive content is medically reviewed or fact checked to ensure as much factual accuracy as possible.
We have strict sourcing guidelines and only link to reputable media sites, academic research institutions and, whenever possible, medically peer reviewed studies. Note that the numbers in parentheses ([1], [2], etc.) are clickable links to these studies.
If you feel that any of our content is inaccurate, out-of-date, or otherwise questionable, please select it and press Ctrl + Enter.
A stomach cramp is a sudden or intermittent sensation of "grasping" pain and tension in the epigastric region, often accompanied by nausea, a feeling of fullness after a small meal, belching, or a burning sensation. This symptom is often associated with functional dyspepsia, gastritis, peptic ulcer disease, Helicobacter pylori infection, the use of nonsteroidal anti-inflammatory drugs, or gastric motility disorders. It is important to remember that "spasm" is a symptom, not a diagnosis, so the doctor's job is to determine the cause and select targeted therapy. [1]
In most people, cramping pain is benign and not associated with a serious underlying condition. However, the presence of "alarm symptoms" (e.g., unintentional weight loss, bleeding, anemia, persistent vomiting, dysphagia) requires more rapid and in-depth diagnostic workup, including endoscopy. Current guidelines emphasize a balanced approach between a thorough history, testing for Helicobacter pylori, and the early initiation of proton pump inhibitors. [2]
Spasms can be primarily gastric or referred (for example, due to gallbladder or pancreatic pathology, or even myocardial ischemia). Therefore, the location of the pain itself does not always indicate the source. Correct differential diagnosis relies on a combination of clinical signs, laboratory tests, and imaging. [3]
Finally, the gut-brain axis significantly influences the severity of symptoms: stress, sleep disturbances, and dietary triggers can exacerbate spasms even in the absence of gross organic pathology. In these cases, non-drug strategies and low-dose neuromodulators in addition to standard therapy are helpful. [4]
Code according to ICD-10 and ICD-11
In clinical practice, "stomach cramps" are coded based on the underlying condition. For functional dyspepsia, ICD-10 uses K30 "Functional Dyspepsia." In ICD-11, functional dyspepsia is designated as DD90.3, and the "Dyspepsia" symptom category is MD92, excluding the functional form. These codes are applied after excluding "alarm" signs and significant organic pathology. [5]
If the cause is established, the following specialized codes are used: K25-K27 for gastric ulcer and duodenal ulcer, K29 for gastritis, K31.84 for gastroparesis, and K58 for irritable bowel syndrome with upper symptoms. The choice of code is dictated by the underlying diagnosis and supporting criteria. [6]
If spasms are caused by drug-induced gastric injury, the appropriate adverse reaction and gastropathy codes are used. If extragastric sources of pain (pancreatitis, cholelithiasis) are suspected, the corresponding nosology codes are used, as this determines treatment tactics and patient routing. [7]
Table 1 summarizes commonly used codes for clinical scenarios associated with upper abdominal cramps.
Table 1. Frequently used ICD-10 and ICD-11 codes for complaints of stomach cramps
| Clinical situation | ICD-10 | ICD-11 |
|---|---|---|
| Functional dyspepsia | K30 | DD90.3 |
| Dyspepsia as a symptom | R10.13* | MD92 |
| Gastritis | K29.x | DD70.x |
| Peptic ulcer disease | K25-K27 | codes under DA61-DA63 |
| Gastroparesis | K31.84 | 5A86.0 |
| * To be specified by local coding guidelines. [8] |
Epidemiology
Functional dyspepsia is one of the most common causes of epigastric cramping and discomfort. Modern meta-analyses show a global prevalence of approximately 6-9% according to strict Rome IV criteria, with a higher incidence in women and a downward trend in recent decades. This reflects both changing diagnostic criteria and a decline in the proportion of H. pylori-associated pathology. [9]
Concomitant functional disorders often overlap: approximately a quarter of patients with functional dyspepsia simultaneously meet criteria for irritable bowel syndrome, increasing the severity of symptoms and the burden on the healthcare system. This requires a comprehensive approach that considers all components of the pathogenesis. [10]
Helicobacter pylori infection remains an important factor in dyspepsia and ulceration, although its prevalence is heterogeneous and declining in developed countries. This influences the choice of a "test and treat" strategy in patients under 60 years of age without "alarm symptoms." [11]
The proportion of severe organic causes of acute epigastric pain in primary care is small, but they must be excluded first in the presence of alarming signs or in older patients, for whom a low threshold of readiness for endoscopy is recommended. [12]
Reasons
The most common causes of stomach cramps are functional dyspepsia, gastritis, peptic ulcer disease, gastroesophageal reflux disease, the effects of nonsteroidal anti-inflammatory drugs, and Helicobacter pylori infection. In some patients, symptoms are triggered by food triggers, caffeine, alcohol, and stress. [13]
Other sources include motility disorders (slow gastric emptying, gastroparesis), post-infectious changes after gastroenteritis, and functional disorders of gastric sensory function, in which a normal volume of food causes early satiety and pain. [14]
Spasms may reflect extragastric pathology: cholelithiasis, pancreatitis, myocardial ischemia, lower lobe pneumonia, and diaphragmatic processes sometimes manifest with epigastric pain. Such cases require vigilance and proper diagnostic procedures. [15]
Finally, a number of medications can provoke spasms and pain: nonsteroidal anti-inflammatory drugs, potassium-containing preparations, iron, and some antibiotics. Management includes a review of the dosage regimen, gastroprotection, or drug substitution. [16]
Risk factors
Non-modifiable factors include female gender, age over 60 years for organic pathology, and a family history of gastric cancer or peptic ulcer disease. These circumstances lower the threshold for endoscopic examination. [17]
Modifiable factors include the use of nonsteroidal anti-inflammatory drugs and anticoagulants, smoking, excessive alcohol consumption, irregular meals with large amounts of fatty foods, and high levels of stress and anxiety. Correcting these factors reduces the frequency and severity of spasms. [18]
The presence of Helicobacter pylori infection, especially in high regional prevalence settings, increases the risk of ulceration and maintains chronic mucosal inflammation. "Test and treat" strategies have proven effective in reducing symptoms in some patients with dyspepsia. [19]
Concomitant functional gastrointestinal disorders, sleep disturbances, and depressive symptoms increase pain perception and the likelihood of relapse. Comprehensive rehabilitation, including behavioral approaches, helps reduce the frequency of exacerbations. [20]
Pathogenesis
The pathogenesis of functional spasms is multicomponent: hypersensitivity of visceral afferents, impaired relaxation of the fundus of the stomach after meals, and discoordination of antral motility create pain and a sensation of "grasping." These mechanisms are combined with altered signal processing in the central nervous system. [21]
Helicobacter pylori induces mucosal inflammation, disrupts the protective mucus layer and the balance between aggressive and protective factors, leading to ulcer formation and cramping pain. Eradication of the bacterium reduces inflammation and lowers the risk of ulcer recurrence and complications. [22]
Nonsteroidal anti-inflammatory drugs (NSAIDs) reduce prostaglandin synthesis, impair mucosal blood flow and its protective properties, and increase susceptibility to acid-peptic injury. This explains the occurrence of spasms and pain after taking such drugs and the need for gastroprotection in at-risk groups. [23]
Psychophysiological factors such as stress and anxiety increase visceral hypersensitivity and smooth muscle spasm via neurohumoral pathways. This justifies the use of psychoeducation, relaxation techniques, and, if necessary, low-dose tricyclic antidepressants in therapy. [24]
Symptoms
The leading symptom is cramping pain or a feeling of "constriction" in the epigastric region, often intensifying after eating, on an empty stomach, or during stress. Additional symptoms include early satiety, a feeling of fullness, nausea, heartburn, and belching. Peptic ulcers may also cause "hunger-like" night pains. [25]
Non-specific symptoms include loss of appetite, flatulence, bowel disturbances, and fatigue. Overlap with irritable bowel syndrome is common and can increase the severity of symptoms. It is important to keep a detailed diary of triggers and symptom dynamics. [26]
Warning signs that require prompt evaluation include dysphagia, persistent vomiting, unintentional weight loss, iron deficiency anemia, bleeding, prolonged symptoms in individuals over 60 years of age, and a family history of gastric cancer.[27]
Extragastric "masks" may resemble spasms: biliary colic, pancreatic pain, myocardial ischemia. If in doubt, an electrocardiogram, pancreatic enzymes, and an ultrasound of the abdominal organs are important. [28]
Forms and stages
Based on the clinical context, functional dyspepsia is distinguished, with a predominance of postprandial distress syndrome (feeling of fullness, early satiety) and episodic epigastric pain, as well as organic forms—gastritis, peptic ulcer disease, and drug-induced gastropathy. This division guides the choice of diagnostic tests and therapy. [29]
Spasms can be acute (onset due to dietary inconsistencies, medications, or infection) or chronically recurring. Chronic spasms often require a "test and treat" strategy for Helicobacter pylori and a trial of proton pump inhibitor therapy with subsequent reevaluation. [30]
Severity is categorized as mild (rare episodes that do not interfere with daily activities), moderate (weekly episodes requiring medication), and severe (daily or nightly pain, decreased performance). This gradation helps plan step-by-step therapy. [31]
Functional dyspepsia can alternate between exacerbation and remission phases, with stress and poor diet being common triggers for relapses. This underscores the importance of non-drug measures in long-term symptom control. [32]
Complications and consequences
The main complications of peptic ulcer disease remain bleeding, perforation, and stenosis of the gastric outlet. The risk is significantly reduced after eradication of Helicobacter pylori and discontinuation of gastrotoxic drugs, as well as with the use of proton pump inhibitors. [33]
Long-term untreated symptoms impair quality of life, sleep, nutrition, and productivity, and increase the risk of anxiety and depressive disorders. The economic burden is associated with frequent medical visits and polypharmacy. [34]
Misinterpretation of symptoms can lead to delayed diagnosis of serious conditions, from stomach cancer to acute surgical procedures. Therefore, "red flags" require prompt verification of the diagnosis and adherence to appropriate routing. [35]
In some patients, prolonged and unnecessary therapy with proton pump inhibitors without reassessment of the indications is associated with risks of drug-induced adverse events, which emphasizes the importance of periodic review of therapy. [36]
When to see a doctor
Seek immediate medical attention if you experience bloody vomiting, melena, severe weakness, fainting, prolonged vomiting with dehydration, persistent resistance to pain medication, or sudden, severe, stabbing pain. These signs may indicate ulcer complications or an acute surgical emergency. [37]
Urgent consultation is necessary for "alarm symptoms": progressive dysphagia, unintentional weight loss, iron deficiency anemia, family history of stomach cancer, age over 60 with new symptoms. In these cases, endoscopy is considered. [38]
A scheduled visit is indicated in case of recurring spasms for more than 4 weeks, in case of relapses while taking non-steroidal anti-inflammatory drugs or antiplatelet drugs, as well as in the presence of concomitant functional disorders that impair quality of life. [39]
If spasms are accompanied by chest pain, shortness of breath, sweating, or radiating pain to the arm or back, it's important to rule out a cardiac cause. Until your doctor's appointment, avoid overexertion and adopt a cautious approach. [40]
Diagnostics
The algorithm begins with a detailed medical history, assessment of medication factors, a food diary, and a search for "alarm symptoms." In patients under 60 years of age without alarm symptoms, a "test and treat" strategy for Helicobacter pylori or a trial course of a proton pump inhibitor with subsequent reevaluation is preferred. [41]
Laboratory tests include a complete blood count to rule out anemia, inflammatory markers, Helicobacter pylori tests (urease breath test or stool antigen test), pancreatic enzymes if needed, liver function tests, and celiac disease serology if indicated. H. pylori tests should be performed before starting proton pump inhibitors or after a test-free interval. [42]
Instrumental methods depend on the clinical situation: esophagogastroduodenoscopy is indicated for patients aged 60+ or in the presence of alarming symptoms; ultrasound examination of the abdominal organs helps to exclude biliary pathology; if ulcer complications or pancreatitis are suspected, computed tomography is used. Motility assessment (e.g., gastric emptying) is indicated if gastroparesis is suspected. [43]
Table 2. Basic diagnostic tests and their interpretation
| Test | Target | What supports the diagnosis | What does it exclude/clarify? |
|---|---|---|---|
| Urea breath test or H. pylori antigen in feces | Detection of H. pylori | Positive result → eradication indicated | A negative result, if the test conditions are met, reduces the likelihood of infection. |
| Complete blood count | Search for anemia/inflammation | Iron deficiency anemia → a warning sign | Normal levels reduce the likelihood of blood loss |
| Esophagogastroduodenoscopy | Examination of the mucosa, biopsy | Ulcer, erosion, neoplasia | The normal picture supports the functional nature |
| Ultrasound of the abdominal organs | Exclusion of biliary pathology | Stones, thickening of the bladder wall | Lack of findings shifts focus to the stomach |
| Computed tomography | Suspected complications | Perforation, inflammatory infiltrate | Normal CT reduces the likelihood of acute complications |
| [44] |
Differential diagnosis
Key areas of differentiation include functional dyspepsia versus organic pathology (ulcers, gastritis), acid-related conditions versus motor disorders, and gastric versus extra-gastric causes. Age, warning signs, food-related factors, response to proton pump inhibitors, and Helicobacter pylori test results are crucial. [45]
It's important to distinguish between biliary colic and pancreatitis, which often present with epigastric pain. Biliary colic pain often occurs 30-90 minutes after eating fatty foods, radiates to the right shoulder, and is accompanied by tenderness in the right hypochondrium; pancreatic colic radiates to the back and intensifies when lying down. When in doubt, ultrasound and pancreatic enzyme tests are used. [46]
Coronary events should be considered in patients with risk factors: myocardial ischemia can mimic "stomach cramps." The presence of shortness of breath, sweating, radiating pain, and stress-related symptoms are indications for an electrocardiogram and cardiac markers. [47]
Table 3. Differential diagnosis of epigastric spasms
| State | Clues in the anamnesis | Confirmation |
|---|---|---|
| Functional dyspepsia | Postprandial discomfort, no alarming signs | Normal endoscopy, negative "red flags" |
| Peptic ulcer disease | Nighttime hunger pains, taking NSAIDs | Positive H. pylori test, ulcer on endoscopy |
| Biliary colic | Pain after fatty foods, radiating to the right | Ultrasound: stones, signs of cholecystitis |
| Pancreatitis | Radiation to the back, nausea, vomiting | Increased lipase/amylase, visualization |
| Cardiac ischemia | Stressful nature, vegetative symptoms | ECG, troponins |
| [48] |
Treatment
1) Non-drug measures
Basic steps include eating small, frequent meals, limiting fatty and very spicy foods, carefully reducing caffeine and alcohol, keeping a food diary, and reducing stress through relaxation techniques. Some patients find a short-term low-FODMAP strategy helpful when combined with functional bowel disorders. [49]
Discussing the regimen for potentially gastrotoxic medications and, if possible, discontinuing or replacing them is an important part of the plan. If necessary, gastroprotective measures are considered while taking the risk medications. The issue of de-escalation must be revisited to avoid overtreatment. [50]
2) Eradication of Helicobacter pylori
In cases of positive tests, eradication is recommended. Current guidelines recommend optimized bismuth-containing quadruple therapy for 14 days as the preferred empirical regimen for cases of unknown susceptibility: a proton pump inhibitor, bismuth, tetracycline, and a nitroimidazole derivative at the recommended doses and frequencies. Alternatively, under certain conditions, regimens containing rifabutin or a potassium-competitive acidifier are considered. Eradication monitoring is mandatory. [51]
3) Acid suppression and alginates
A 4-8-week trial course of proton pump inhibitors reduces acid-peptic aggression and spasmodic pain, especially in peptic ulcers and gastritis. For mild symptoms, short-term use of antacids and alginates as "rescue" agents is acceptable. It is important to periodically reassess the need for therapy and use the minimum effective dose. [52]
4) Antispasmodics and prokinetics
To relieve the spasm itself, myotropic antispasmodics and anticholinergics are used, and if a motility disorder is suspected, short courses of prokinetics are used. In cases of severe nausea, short courses of prokinetics are acceptable, taking into account the risk of side effects. The decision is made individually, based on the symptom profile. [53]
5) Neuromodulators and behavioral therapy
For functional dyspepsia with severe visceral hypersensitivity, low doses of tricyclic antidepressants are considered, as they reduce pain intensity independent of the antidepressant effect. Psychoeducation, cognitive-behavioral approaches, and stress management techniques enhance the effectiveness of drug therapy. [54]
6) Treatment of complications and alternative routes
Ulcer bleeding requires hospitalization, endoscopic hemostasis, and acid suppression. Suspected biliary colic with frequent recurrences is a reason to consider cholecystectomy. If pancreatitis is suspected, urgent evaluation and infusion therapy according to protocols are indicated. [55]
Table 4. Stepwise therapy for stomach cramps (summary)
| Step | What are we doing? | When we move on |
|---|---|---|
| Basic | Nutrition, diary, medication adjustments, stress reduction | If severe symptoms persist after 2-4 weeks |
| H. pylori testing and treatment | Testing and eradication if positive | In case of ineffectiveness/negative tests |
| Trial course of IPP | 4-8 weeks with re-evaluation | In case of partial responses - dose/schedule optimization |
| Antispasmodic/prokinetic | Individually based on the symptom profile | If pain and hypersensitivity persist |
| Neuromodulator/behavioral methods | Low-dose tricyclic antidepressant + psychoeducation | In case of resistance - review of diagnosis, endoscopy |
| [56] |
Prevention
Reducing the consumption of fatty and very spicy foods, moderating caffeine and alcohol, eating small meals regularly, and staying well hydrated can help reduce the risk of cramping episodes. Keeping a food and symptom diary can help identify individual triggers. [57]
Avoid unnecessary use of nonsteroidal anti-inflammatory drugs, especially in combination with anticoagulants or in individuals with a history of peptic ulcer disease. If long-term therapy is necessary, consider gastroprotection. [58]
In regions with a significant prevalence of Helicobacter pylori, a "test and treat" strategy in symptomatic patients under 60 years of age without warning signs reduces the risk of peptic ulcer disease and relapse. Eradication monitoring is mandatory. [59]
Mental hygiene, quality sleep, and regular physical activity reduce visceral hypersensitivity and the frequency of relapses. Patient education and realistic expectations are important elements of long-term success. [60]
Forecast
Most patients with spasms due to functional dyspepsia have a favorable prognosis: symptoms are controlled with a combination of non-drug measures and pharmacotherapy. However, relapses are common, especially in the presence of stress triggers and overlap with other functional disorders. [61]
In H. pylori-associated peptic ulcer disease, eliminating the infection and discontinuing nonsteroidal anti-inflammatory drugs significantly reduces the risk of relapse and complications, improving quality of life. [62]
The absence of "alarm symptoms" indicates a low probability of malignancy; however, if they appear, a reassessment and possibly endoscopy are necessary. This dynamic approach allows for rapid adjustments to the plan. [63]
With proper routing of patients with extra-gastric causes of pain, the outcome is determined by the timely treatment of the underlying pathology, which emphasizes the role of a differential approach. [64]
Table 5. Factors of favorable and unfavorable prognosis
| Factor | Impact on prognosis |
|---|---|
| Eradication of H. pylori | Reduces ulcer recurrence and bleeding |
| No red flags | Low risk of serious pathology |
| Managing stress triggers | Fewer recurrences of functional pain |
| Long-term unjustified use of PPIs | Risk of drug-induced adverse events, need for de-escalation |
| [65] |
FAQ
- Is this definitely a "stomach cramp" and not something else?
The term "spasm" describes the sensation. The pain can originate either in the stomach or outside it. Focus on accompanying symptoms and follow the algorithm: assessment of warning signs, testing for Helicobacter pylori, a trial course of therapy, and, if necessary, endoscopy. [66]
- Do you always need to take proton pump inhibitors?
No. For some patients, non-drug measures and "rescue" agents are sufficient. When prescribing proton pump inhibitors, it is important to limit the duration of treatment, periodically reassess the need, and use the minimum effective dose. [67]
- Should I treat Helicobacter pylori if I test positive?
Yes. Current guidelines recommend eradication followed by follow-up, preferably with optimized bismuth-containing quadruple therapy for 14 days, as an empirical first-line regimen.[68]
- Can stress and anxiety make cramps worse?
Yes. The gut-brain axis influences hypersensitivity and motility. Psychoeducation, relaxation techniques, and, if necessary, low-dose neuromodulators as part of combination therapy are effective. [69]
- When is it necessary to have an endoscopy?
In patients aged 60+ with new symptoms, the presence of “red flags”, as well as with persistent symptoms after initial treatment according to the algorithm, endoscopy is discussed to exclude organic pathology. [70]
Where does it hurt?
What do need to examine?
What tests are needed?
Who to contact?

