A racing heart during diarrhea is usually caused by fluid loss. Diarrhea removes water from the body quickly, which lowers your blood volume.
When blood volume drops, your heart has to beat faster to keep blood pressure stable and deliver oxygen to your organs. This faster heartbeat is your body’s way of compensating for less fluid in your bloodstream.