It was the top seed and five-time champion’s 53rd career win at his hometown event, the place where he got his start in the sport as a ballboy two decades ago.
He now stands at a perfect 6-0 over world number 55 Istomin, who gave Federer plenty of trouble during their one-hour, 48-minute meeting.
Federer’s win kept up the pressure on Novak Djokovic as the Swiss takes aim at a possible return to the year-end world number one ranking currently held by the Serb.
But the 33-year-old admitted his start had been slow.
“I was lacking rhythm in first set, it was close but he played well when he had to. He served well on the break point he faced.
“It was tough to lose that set but it was important to bounce back in the second set and get my teeth into the match.
“In the third I got the upper hand and was moving him around the baseline. I was more consistent, it just took awhile to make the breakthrough.
“In the end it was a tough and good match for me. The key was to clears up my game, get the win and give myself an opportunity for tomorrow.”
Federer, who won his first-round match in 45 minutes, lost the opening set on a break as Istomin landed a return at his feet for a crucial 4-2 lead.
The second set momentum finally turned for Federer, who fired three love games and lost just two points on serve as he levelled with a forehand winner to the corner on set point.
In the third, the Swiss was frustrated by stubborn Istomin defence, with Federer missing on four break points in the opening game before finally breaking for 2-1 on the eighth break point of the set, a passing winner.
Federer completed his comeback with a sixth ace on match point to advance into a quarter-final against either fifth seed Grigor Dimitrov, who beat Canadian Vasek Pospisil, a 2013 semi-finalist, 6-2, 6-2.
Canadian fourth seed Milos Raonic continued his winning tournament debut with 22 aces as he overcame American Donald Young 6-4, 6-7 (5/7), 7-6 (7-2) in nearly two and a half hours.
“There were things I had to do differently, but at the end of the day the most important thing was to win, no matter how,” said the Canadian.
Croatian eighth seed Ivo Karlovic needed to go the distance to beat Kenny De Schepper 6-7 (6/8), 6-4, 6-3.
German Benjamin Becker advanced when Mikhail Kukushkin, who beat Australian Open champion Stan Wawrinka in the first round, retired with a shoulder injury at 0-4 in the final set.
Croatian teenager Borna Coric reached the last eight with a 6-4, 6-4 win against Andrey Golubev. (AFP)