The top seed, unbeaten in Basel since 2013, is an eight-time winner of his home event and will next play Frenchman Gilles Simon, who defeated Latvia's Ernests Gulbis 7-6 (7/4), 7-6 (7/0).
Federer admitted he was not satisfied with his slow start, going down a break in the third game.
"I didn't really get into the game. It's been a long time since I've played a match a match without being broken. I have to improve in the next round."
The 37-year-old, ranked third in the world, trailed to the early break but soon recovered for 3-all in the opening set. He then broke for 5-3 before closing out the opener in 27 minutes.
The second set stayed on serve until a fifth double-fault from Struff, which opened the door for Federer to move 6-5 ahead.
Moments later, the 20-time Grand Slam champion served out a 41st victory of the season with a volley into the empty court on his first match point.
"It was a lot of rocky start, I had to clean up my game, I'm happy about that," Federer said.
"There were a lot of quick points - one or two shots max. There was no rhythm, it was a sprint on the majority of points.
"I did a little better than him I guess, that was the goal."
Federer will take on French Gilles Simon, ranked 32nd in the world. later today. The two have played each other eight times, with Federer winning on six of those occasions.