"Headphones contain magnets, and some of these magnets are powerful," said the study's leader, Dr. William Maisel, a cardiologist at Beth Israel Deaconess Medical Center in Boston and a heart device consultant to the federal Food and Drug Administration.
"I certainly don't think people should overreact to this information," but it's smart to keep small electronics at least a few inches from implanted medical devices, and not let someone wearing headphones lean against your chest if you have one, he said.
"The headphone interaction applies whether or not the headphones are plugged in to the music player and whether or not the music player is on or off," he added.
Maisel's research was presented Sunday at an American Heart Association conference.
Nearly 2 million people worldwide have pacemakers, defibrillators or other devices to help their hearts beat faster, slower or more regularly. Tests by the FDA earlier this year concluded that iPods or other music players posed no threat to these devices as long as they were used properly.
Maisel and other doctors wanted to know if the same was true of headphones. They tested eight models - earbuds and those that hook over the ear - in 60 people with heart devices.
When headphones were about an inch from the device, interference was detected nearly one-fourth of the time - in four of the 27 pacemaker patients and 10 of the 33 with defibrillators. A pacemaker reset itself in one patient.
Patients having such interference might not feel anything, or may have heart palpitations. But the interference could temporarily deactivate a defibrillator, keeping it from delivering a lifesaving shock if one were needed.
The magnet's effect falls off rapidly with distance from the device, and heart device function returns to normal as soon as the headphone is out of range.
The study did not test larger or noise-canceling headphones. The size of the headphone doesn't necessarily relate to magnetic strength; small, portable ones typically use neodymium, which is one of the most powerful and concentrated magnetic substances, Maisel said.
A separate study presented at the heart conference found no danger to heart devices from cell phones equipped with Bluetooth wireless technology.
Cell phones, anti-theft security devices and a host of other electronics have sparked fears in the past, but studies generally find no danger to heart devices with ordinary, prudent use, said Dr. Douglas Zipes, past president of the American College of Cardiology and professor of cardiology at Indiana University.
"Reassurance to the public is what's warranted. I still get questions, what about my microwave?" he said.
Dr. Kenneth Ellenbogen, a heart device expert at Virginia Commonwealth University and a spokesman for the heart association, said the solution is simple: "Keep your headphones on your ears and when they're not on your ears, you shouldn't put them over your chest or your pacemaker."