The vast majority of oral medications contain ingredients that could cause adverse reactions in patients, new research suggests.

The culprits are so-called "inactive" ingredients: hundreds of thousands of different additives that help make up drugs but are not the medicine's main functional component.

When a doctor hands you a prescription for a drug, the most important part of the medicine is what's called the API: the active pharmaceutical ingredient, the chemical intended to make you well.

But the API isn't the only thing in the drugs people buy.

Up to 99 percent of a pill or tablet can be made up of excipients: supposedly inert fillers that otherwise help the drug in terms of its appearance, consistency, colour, flavour, or other physical properties.

Excipients, also known as bulking agents, are often listed as "inactive ingredients" on medication packaging, but that term is something of a misnomer.

Unlike the API, excipients aren't supposed to have any direct therapeutic effect, which is why they're defined as "inactive", but that doesn't necessarily mean they're inactive or inert in other ways.

"While we call these ingredients 'inactive,' in many cases, they are not," says gastroenterologist Giovanni Traverso from MIT and Brigham and Women's Hospital.

"While the doses may be low, we don't know what the threshold is for individuals to react in the majority of instances."

Traverso was inspired to study inactive ingredients after being involved with a case five years ago in which a patient with coeliac disease reacted poorly to omeprazole, a drug used to treat stomach ulcers.

The formulation taken by the patient contained ingredients derived from wheat products which may have included gluten. Those components could have been why the patient felt sick after taking the drug.

"That really brought it home to me as far as how little we know about tablets and the potential adverse effects they might have," Traverso says.

In the new study, Traverso and fellow researchers analysed the public database Pillbox, which contains information on over 42,000 oral medications marketed in the US, and more than 350,000 inactive ingredients that are used to make the drugs.

On average, tablets or capsules contain 8.8 inactive ingredients, but hundreds have 20 or more, the researchers say, and sometimes over 30.

About one-third of inactive ingredients only turn up once in the database, whereas others are common components (like magnesium stearate, which features in 72 percent of oral drugs).

Usually, inactive ingredients make up over 50 percent of a pill, but sometimes it's as much as 99 percent, the team says.

None of those statistics are necessarily problematic, but some of the data the team unearthed is more concerning.

Specifically, 38 of the inactive ingredients identified by the team have been reported as causing allergic symptoms in the past, and 92.8 percent of all the oral medications in Pillbox contain at least one potential allergen, while 55 percent contain at least one FODMAP sugar.

"For most patients, it doesn't matter if there's a little bit of lactose, a little bit of fructose, or some starch in there," explains one of the team, biochemical data scientist Daniel Reker from MIT.

"However, there is a subpopulation of patients, currently of unknown size, that will be extremely sensitive to those and develop symptoms triggered by the inactive ingredients."

The problem is compounded by the fact that while inactive ingredients are usually listed on packaging, their relative amount in the drug isn't detailed.

Also, when doctors prescribe medicines to patients, they may only specify the dosage of API, not the formulation itself – and sometimes it's impossible to avoid certain inactive ingredients across multiple different formulations of a particular drug.

The risks may be multiplied in terms of older patients too, given the elderly often take numerous drugs – potentially exposing them to a harmful build-up of inactive ingredients they might be sensitive to.

"A patient taking 10 prescription medications would ingest an average of 2.8 grams of inactive ingredients daily," the authors write.

"This is a substantial amount of excipient material that is administered to patients every day and merits further consideration."

To sum up, there are numerous reasons why the team says more attention in the future needs to be paid to these ingredients that so far have flown under the radar – and also to how they are regulated and given to patients.

"Accounting for effects of excipients will enable advanced formulations for difficult-to-deliver medications and could lead to personalised medicine for vulnerable sub-populations," the authors explain in their paper.

"Such analysis will empower clinicians to make conscious selections of formulations focusing on their patients' well-being."

It's worth pointing out that three of the authors are listed as co-inventors on a provisional patent application for a system that uses algorithms to quantifying and detail inactive ingredients in medications.

On the one hand, this means they might have a commercial interest in publicising the risks of inactive ingredients, which is something to bear in mind.

But hopefully it also means the issues they've highlighted become easier to navigate one day, thanks to an app or website that can effectively explain just what we're buying at the pharmacy.

"We were surprised by the results," Traverso told NBC News.

"It involves almost every pill and capsule. And it's something we tend not to think about."

The findings are reported in Science Translational Medicine.