The second-seeded Federer used an effective slice serve on the fast indoor surface and was never broken.
"The slice goes nicely on this court, I felt good using it to counter Juan Martin's height,'' Federer said.
Federer also played serve-and-volley, chip and charge returns and clean passing shots against his 20-year-old opponent.
Del Potro served 12 aces, including 11 in the first set, but couldn't trouble Federer.
"He started serving great, many aces,'' Federer said. "That's what makes him the good player he is. I had the ability to stay calm and use my slice well here in Madrid where conditions are very quick.''
Federer was helped by Del Potro's four double-faults.
"Roger generates pressure just by being in front of you,'' the Argentine said. "I double-faulted on my serve in each set to lose the match. Roger gave nothing away and I wasn't able to even take a set off him.
"He broke my rhythm all the time and took full advantage of his break points, which I wasn't able to do, that's the difference.''
Federer, who missed last week's Stockholm Open due to fatigue, said he felt happy with his physical condition.
"I don't know what would have happened if I'd gone to Stockholm, but I'm playing well here,'' he said.
Federer's semifinal opponent will be fourth-seeded Murray, who beat Gael Monfils of France 6-2, 6-2.
Federer beat Murray in the U.S. Open final, 6-2, 7-5, 6-2.
"I'll have to come with a proper game plan,'' Federer said. "He played well against Monfils, so I'll have my hands full with him.''
Monfils broke Murray in the opening game, but the U.S. Open finalist broke back immediately. Murray broke two more times to take the set. The second set followed the same pattern.
"He almost enjoys running too much and almost likes you to dictate play,'' Murray said of his 22-year-old opponent. "Once he get used to big matches we're going to be seeing a lot more of him.''
In other quarterfinals later Friday, top-seeded Rafael Nadal played Feliciano Lopez in an all-Spanish matchup, and Gilles Simon of France faced Ivo Karlovic of Croatia.
Usain Bolt Is A Blanco
Murray through to Madrid Masters semifinals