The Swiss world number two was pushed all the way and needed five match points before eliminating seventh-seeded Tsonga to win 7-6 (7/4), 4-6, 7-6 (7/4), 3-6, 6-3 in 3 hours 34 minutes at the Rod Laver Arena.
His victory has set up a rematch of last year's Wimbledon final with third seed Murray in Friday's semi-final.
World number one Novak Djokovic will play Spanish fourth seed David Ferrer in the other semi-final on Thursday.
It was Federer's composure under pressure that won the day in the fifth set against the explosive Frenchman, who frequently gave the Swiss great problems with his all-court game.
Federer handled the tension of the deciding set and got a crucial break in the fourth game to take control, but was forced to five match points before he could put Tsonga away to improve his five-set record to 21-16.
"It was a tough close, for sure, the whole match was tough and any set could have gone either way," Federer said.
"It's tough because you never know what Joe is going to come up with.
"I hit three great serves there in the fifth set and every time he got them back, and that's what he can do and that's why he remains dangerous throughout a match."
Federer has now reached the semi-finals at the Australian Open for the 10th straight year and also extended his record number of Grand Slam semi-final appearances to 33.
The Swiss great is bidding to become only the second man to win five Australian titles behind Australian Roy Emerson, who won six in the 1960s.
Federer began well breaking Tsonga's opening service game but the Frenchman hit back with the Swiss losing his serve for the first time in the tournament.
The set went to a tiebreaker and Federer played the big points the better to go one up after 50 minutes.
The athletic Tsonga took the second set after breaking Federer in the seventh.
Both players exchanged breaks early in the third set and again it went to a tiebreaker.
Once again the world number two revelled in the pressure moments and took the set after a magnificent retrieve which forced Tsonga to hit out and hand Federer a two sets to one lead.
Tsonga fought back with two more service breaks to take the match into a fifth set but Federer was more consistent on the big points to get home.