When aches and pains hit, a lot of Americans think Advil, Tylenol and other over-the-counter painkillers are basically interchangeable for dealing with the problem. That’s definitely not the case, according to top physicians across the country, and findings from several recent studies show these pills work differently in the body, the Wall Street Journal reports.

Tylenol (generic name: acetaminophen) and Advil (ibuprofen) are largely considered safe for both adults and children. But doctors said each med has distinct side effects to consider. Too much acetaminophen can tax the liver and thin out the blood; ibuprofen, which is in a class of drugs known as nonsteroidal anti-inflammatory drugs (NSAIDs), can cause gastrointestinal issues.

Studies show that these painkillers also work differently in the body. Acetaminophen affects the central nervous system by blocking pain receptors in the brain. NSAIDs (which also include Aleve and Motrin) inhibit the production of prostaglandins, chemicals released by cells that trigger inflammation.

This is why most doctors recommend acetaminophen over other painkillers for headaches. But for an inflamed joint, backache or sports injury, research shows ibuprofen works best. To reduce a fever or combat menstrual cramps, docs say both medications work well, but studies show NSAIDS might have a slight edge because of their anti-swelling properties.

Experts also advise people with a history of gastrointestinal and kidney issues to steer clear of ibuprofen. The same goes for people with liver disease and acetaminophen. Babies younger than 6 months old and pregnant women should also avoid taking NSAIDs because these drugs are linked to Reye’s syndrome, a condition that can cause dangerous swelling in the brain and liver of young kids.

For more information about painkiller risks, click here.