There are several causes of exercise-induced stomach pain. It could be as simple as a cramp in your stomach wall muscles, or gastrointestinal distress. It could also be a side effect of decreased oxygen availability in your system or dehydration.
Cramps
Stomach cramps during exercise have several causes. It's possible your electrolytes are out of balance. If you don't have enough salt in your blood, fluids only slosh about in your stomach instead of being processed and helping you continue exercising. This can lead to an upset stomach and even vomiting if you're not careful. There's also the problem of what and how much to eat before or during exercise. According to Spinalhealth.net, if you consume too much food--especially food with high sugar levels--before you exercise or compete, you will likely get a stomachache.
Gastrointestinal Distress
Particularly in endurance athletes, gastrointestinal distress is a common issue. You may feel bloated, burp, or urgently need to use the restroom. Dr. Christopher Jensen, a nutrition and epidemiology researcher for PowerBar, suggests that the actual motion from exercise may cause a disruption in your digestive tract. That disruption, combined with a decrease in blood flow to your gut and an increase in the secretion of digestive hormones that can be brought on by exercise, may cause GI distress and stomach pain.
Decreased Oxygen
While you're exercising, your breathing rates change. It's likely that your oxygen intake is not sufficient to cover the oxygen deficit, also called and oxygen debt, that you develop within minutes of starting your exercise. According to Dr. Jensen, it's not yet completely understood where side stitches originate, but one theory is that people tend to take shallow breaths originating in the chest and rib cage during exercise. When you're not exercising, you utilize your diaphragm to take long, deep breaths. If you bypass your diaphragm and rely on your intercostal and chest muscles for breathing, you may cause a spasm in your diaphragm, which can result in a side stitch, or stomach pain.
Dehydration
Dehydration can result in decreased blood volume in the blood altogether because water is pulled from your blood if it's not present in adequate amounts throughout the rest of your body. Jensen points out that this decrease in blood volume subsequently results in even less blood being sent to your digestive tract and causes GI distress.
Solutions
Although there is no way to guarantee that you won't suffer from stomach pain with exercise, there are ways to reduce symptoms or avoid causes. First, be sure to pre-hydrate, meaning consume enough fluids to avoid becoming dehydrated quickly with the start of exercise. You can also monitor how soon you eat before you exercise. Jensen and spinalhealth.net recommend giving your body sufficient time to digest your pre-workout snack before beginning exercise. Avoid consuming foods too high in sugar or carbohydrates before or during exercise.


