Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

If you get sick after taking a new medication, the problem may not be with the drug itself, but the so-called inactive ingredients in the pill, a new study suggests.

The vast majority of frequently prescribed drugs contain at least one inactive ingredient that can lead to an adverse reaction in some people, according to a report published Wednesday in Science Translational Medicine.

For the most part, the inactive ingredients only pose a risk for people with allergies — to certain food dyes, for example — or intolerances to substances such as lactose. But some of the ingredients can worsen symptoms in people with conditions such as irritable bowel syndrome, or IBS.

“We were surprised by the results,” said gastroenterologist and co-author Dr. Giovanni Traverso, of Brigham and Women’s Hospital and Harvard Medical School. “It involves almost every pill and capsule. And it’s something we tend not to think about.”

Traverso, who is also in the mechanical engineering department at MIT, got the idea for the study after being asked to consult on a case involving a patient with Celiac disease who had been prescribed a medication that turned out to have gluten in it.

“The patient was not aware that gluten could be in a medication,” he said.

As the research team examined the medical literature for patients who had experienced adverse reactions after taking a prescription medication, it became clear there were many drug formulations that contained substances that could cause harm — sometimes minor and sometimes major.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

Some patients developed severe diarrhea after taking pills that contained lactose as the inactive ingredient. Other cases included Celiac patients experiencing side effects from drugs with gluten. In 2017, the FDA issued draft recommendations on how to label wheat-derived ingredients in certain drug products.

The FDA provides a database to search for all ingredients, including inactive compounds, in prescription drugs.

Researchers have also looked at whether food dyes used in some medications might be an issue. In one study researchers tested a common food coloring — the yellow dye called tartrazine — in 2,210 volunteers and documented allergic reactions in 83 people, or 3.8 percent.

The researchers studied databases that catalogue the entire contents of known medications. In one example, a certain lipid-lowering medication contained 5 mg of the drug and 700 mg of inactive ingredients.

Among the team’s other findings were:

Approximately 45 percent of medications contained lactose.

Approximately 33 percent contained a food dye.

55 percent contained at least one hard-to-digest sugar linked to symptoms of gas, bloating, abdominal pain, diarrhea, constipation.

“Many probably have amounts that are low enough that they wouldn’t induce a reaction, but in patients taking more than one medication they might pose a problem,” Traverso said. “For example, lactose is in a significant proportion of medications.”

Some drugs contain inactive ingredients that might actually worsen symptoms in conditions the medications are prescribed to treat. As an example, Traverso points to the hard-to-digest sugars, known as FODMAPS (fermentable oligosaccharides, disaccharides, monosaccharides, and polyols), that can worsen symptoms of IBS.

Why are inactive ingredients in pills?

Most pills contain only a tiny amount of medication, explained Sravan Kumar Patel, a pharmaceutical chemist and an instructor of pharmaceutical sciences at the University of Pittsburgh Medical Center.

“If the required dose is 5 mg, that’s a really small amount and you can’t make a tablet out of that,” Patel said. “So you mix it with an inactive ingredient such as lactose or dextrose and now you can make a tablet. It might not form into a tablet if you use something else.”

The choice of inactive ingredients can make the difference between a drug formulation that disintegrates quickly in the stomach, allowing it to be absorbed more rapidly by the body, and one that is absorbed more slowly in an extended release, Patel explained.

In most cases the small amounts don’t cause a problem for patients, Patel said. But they might in cases where patients are taking multiple medications containing an ingredient such as gluten or lactose, he added.

Patients with severe food allergies or chronic conditions like Celiac should pay special attention when they are given a new prescription, said Dr. Corinne Keet, an associate professor of pediatrics at the Johns Hopkins Children’s Center. For anyone having unexpected symptoms while taking a medication, have the doctor check the ingredient list.

“We do occasionally see people who have reactions we think are related to inactive ingredients," said Keet.