The American triumphed in four sets - three of which went to tie-breaks - to knock out the 12th seed and book a meeting with Federer, who dispatched Marton Fucsovics after a nervy start.
There were few signs of the jitters for Novak Djokovic against Diego Schwartzman, while Milos Raonic's relentless serving strength saw him power past 2018 finalist Marin Cilic.
Canadian Raonic said he felt "pretty damn good" after a straight-sets win that included 35 aces, although he admitted he will need even more to beat defending champion Djokovic next.
SANDGREN FIGHTS THROUGH FOGNINI FRUSTRATION
Sandgren traded winners and barbs with Fabio Fognini before prevailing 7-6 (7-5) 7-5 6-7 (2-7) 6-4 to seal his second Australian open quarter-final berth.
Tempers frayed across four entertaining sets on Melbourne Arena, with the American becoming upset at his opponent's stalling tactics.
Fognini, the 12th seed, argued with the umpire, took a lengthy bathroom break and asked for a medical timeout to treat blisters all before the third set, leading Sandgren frustrated.
"He gets his own rules because you're afraid to step on his toes," the world number 100 told the umpire after taking the opener.
Sandgren, who lost to Chung Hyeon in the last eight two years ago, regained his composure and went on to complete the upset in three hours and 27 minutes.
FEDERER FINDS FORM AFTER EARLY WOBBLE
Federer seemed to be feeling the effects of his epic five-set victory over John Millman as Fucsovics took an early lead on Rod Laver Arena.
However, the 38-year-old recovered in supreme style and seemed somewhere close to his best tennis at the end of a 4-6 6-1 6-2 6-2 victory.
As the full repertoire of shots from Federer began to paint the lines, Fucsovics had little response.
The 20-time major champion is now looking forward to a first meeting with Sandgren. "I have played a lot of tennis in my life, but never against Tennys," he said.
DJOKOVIC POWERS PAST SCHWARTZMAN
Djokovic produced another dominant display to dismantle Schwartzman 6-3 6-4 6-4 on Rod Laver Arena, where the world number two kept his title hopes alive.
While Schwartzman fought hard, it was another routine outing for Djokovic - who reached his 11th Australian Open quarter-final.
Djokovic was broken for the first time since the opening round but was never really in danger, hitting 38 winners and 31 unforced errors.
"Today was a good test because Diego was in form, he hasn't dropped a set in three rounds," the Serbian said afterwards.
"Obviously he can be a very dangerous opponent from the baseline if you give him time. I knew that. I stepped out on the court with a clear game plan what I need to do."
RAONIC TAKES DOWN CILIC
It rained aces as 32nd seed and former world number three Raonic beat former runner-up Cilic 6-4 6-3 7-5.
Raonic progressed to his fifth quarter-final in Melbourne after firing down 35 aces and winning all of his service games in two hours and 19 minutes.
His reward? A showdown with Serbian superstar Djokovic, who boasts a dominant 9-0 head-to-head record.
"I'm going to have to serve well clearly, and then I think I'm going to have to get my return at a high percentage, make him play a lot of those points, and then try to be efficient on my service games," Raonic said in his news conference.
"I think we play quite opposite from each other, and he's done a good job in the past neutralising my serve. So I have really got to focus on my things well and be the one dictating."