Swelling and pain in both ribs accompanied by heartburn, the possible clinical causes are gastritis, gastroesophageal reflux disease and so on. 1. Gastritis: this disease refers to acute and chronic inflammation of the gastric mucosa caused by a variety of different etiological factors, the causes of acute gastritis include alcohol, stress, trauma, etc., while chronic gastritis is mainly associated with Helicobacter pylori infection, autoimmune diseases, etc., and the main clinical manifestations include abdominal distension, nausea, pain in the upper and middle abdominal areas, and gastrointestinal bleeding. 2. Gastroesophageal Reflux Disease (GERD): This disease refers to the discomfort and complications caused by the reflux of gastric contents into the esophagus, a small number of people whose reflux can reach the pharynx and the oral cavity and cause extra-esophageal symptoms, the clinical manifestations of which include chest pain, a burning sensation in the epigastric region, coughing, belching and so on. If symptoms such as swelling and pain in the two ribs and heartburn persist, it is recommended to go to the hospital for a clear diagnosis through relevant examinations, so as to carry out targeted treatment.