The fifth-seeded Thiem outlasted Federer in the second-set tiebreaker and broke him twice in the third set to close out the match in more than two hours.
He took a quick 4-0 lead in the first set before Chardy saved three break-points to hold on to his first service game.
It may have ended his first appearance at a clay-court tournament in three years, but Federer wasn't leaving the Spanish capital too disappointed. Thiem then served out for the victory, converting on his second match point.
Rafael Nadal beat Stan Wawrinka 6-1 6-2 to set up a clash with Stefanos Tsitsipas, who edged Alexander Zverev 7-5 3-6 6-2, in the other semi.
The Frenchman fought harder in the second but Djokovic completed a straight-set win in 85 win to waltz into the quarter-final.
He will meet either Roger Federer or Dominic Thiem, who face off on Saturday, in the last four.
Djokovic won the Madrid title in 2016 and 2011.
He will face ninth seed Marin Cilic next after the Croatian put out Laslo Djere 4-6, 6-3, 6-2, winning 11 of the last 13 games. "He's won the last three Slams and he is at the top of the ranking again".
Roger Federer, from Switzerland, reacts after losing a point during the Madrid Open tennis match against Dominic Thiem, from Austria, in Madrid, Spain, Friday, May 10, 2019. "So the challenge couldn't be bigger".
- No Hurry to Sign China Deal
- James Cameron congratulates Marvel for 'Avengers: Endgame' success as is tradition
- Philippines, US, Japan, India navies sail together in South China Sea
- Plastic polymer can be endlessly recycled !
- Arsenal keeper Petr Cech explains ‘remarkable’ Chelsea ‘dream’ after Europa League win
- Roger Federer will play Italian Open in warm-up for Roland Garros
- 9-year-old MI boy charged with murdering his mother
- Rangers have huge disciplinary problem, says Celtic boss Lennon
- Offset Shooting: Migos Rapper Possible Target In Drive-By Shooting At Studio
- Finally! Sonos says it’ll launch Google Assistant for select speakers next week