The 35-year-old Swiss, who is aiming for a record eighth Wimbledon crown and 19th Grand Slam title, beat Alexander Zverev 6-1 6-3 in 53 minutes.
German Zverev, 20, beat Federer in last year's semi-final.
"It was by far my best match of the week. I'm feeling excellent and it's a pleasure to be back," said Federer, who skipped the clay-court season to rest.
Wimbledon starts on Monday, 3 July.
Federer, who dropped just nine points on his serve, has won four titles this year, a tally matched only by long-time rival Rafael Nadal.
Federer won the Australian Open in January - his first Grand Slam success in five years - despite not playing in the previous six months, claimed the BNP Paribas Open at Indian Wells in March and won the Miami Open two weeks later.
In May, he announced he would miss the French Open and the rest of the clay-court season to concentrate on the grass- and hard-court seasons.
Federer produced an imperious display against world number 12 Zverev, who is regarded as one of the world's most promising players and reached the top 10 this year after winning three titles.
"It has been a difficult year. I have spent a lot of time on practice, training and rehab so it is nice to be back on court," said Federer, who suffered a surprise defeat by Tommy Haas in Stuttgart this month.
"I'm not sure if I am going to win this tournament again so I want to enjoy it as much as I can."
Top seed Federer broke to love in the opening game, established a 4-0 lead and wrapped up the first set in 22 minutes.
He survived a break point in the opening game of the second set - the only chance created by Zverev - before sealing victory with a backhand volley.
Federer, whose first success at Halle came in 2003, has won 92 career titles from 140 finals.
Find out how to get into tennis in our special guide.
Roger Federer warmed up for Wimbledon by winning a record ninth title at the Gerry Weber Open in Halle, Germany.