The causes of pain and swelling in both ribs include liver and gallbladder diseases, trauma, intercostal neuralgia, pleural or lung diseases, herpes zoster and so on. 1. Liver and gallbladder diseases: such as liver tumor, cirrhosis, cholecystitis, gallbladder stones, etc., can cause pain and discomfort in the right rib, which can be diagnosed by ultrasound of liver, gallbladder, spleen and pancreas. 2. Trauma: when trauma causes rib fracture and costochondritis, pain and discomfort in both ribs can occur, patients usually have a history of trauma, and diagnosis is not difficult. 3. Intercostal neuralgia: cold, overwork, high mental tension, etc., may cause intercostal neuralgia. The pain may be distributed along the intercostal nerves. 4. Pleural or lung diseases: such as pleurisy, pneumonia, pleural effusion, etc., can also cause pain in both ribs when they invade the pleura. 5. Herpes zoster: pain distributed along the intercostal nerve can occur, accompanied by blisters and other symptoms, and the pain is usually more intense. Symptoms of pain in both ribs need to go to the hospital for further examination to confirm the diagnosis and clarify the cause of the disease before treatment.