Second-ranked Federer, who saved five match points in winning their only prior meeting last year at Shanghai, will next face either Belgium's Steve Darcis or Cypriot Marcos Baghdatis.
The 34-year-old Swiss star, seeking his 18th Grand Slam singles title, could capture his sixth US Open crown and become the oldest US Open men's champion in 45 years.
The 17-time Grand Slam champion fired 12 aces, 29 winners and broke serve six times as the crushing heat
and humidity took the number of first-round retirements in the tournament to a record nine.
"I got off to a good start and my serve got better as the match went on," said Federer.
Meanwhile, Swiss fifth seed Stan Wawrinka reached the US Open second round on Tuesday with a 7-5, 6-4, 7-6 (8/6) win over Spain's Albert Ramos-Vinoles.
Wawrinka, the French Open champion, will tackle South Korean teenager Chung Hyeon for a place in the last 32.
However, the day's drama was being served up on Court Five where Australia's Thanasi Kokkinakis retired on one leg in the fifth set against French 12th seed Richard Gasquet.
The 19-year-old Kokkinakis, who was caught up in compatriot Nick Kyrgios's infamous sex slur against Wawrinka in Montreal, suffered from cramping and was warned by the umpire that he was putting his health at risk if he continued.
But he battled on, serving from a standing start and forced to play at walking pace before he finally gave up, losing 4-6, 6-1, 4-6, 6-3, 2-0 after almost three hours in 30-degree heat.
He was the eighth man to retire from the first round, a record for the US Open before Kazakhstan's Aleksandr Nedovyesov quickly became the ninth.
He was down 6-0, 7-6 (7/2), 1-0 to former champion Lleyton Hewitt when he called a halt after suffering a right shoulder injury.
Earlier, Latvia's Ernests Gulbis also quit, handing Great Britain's Aljaz Bedene a 3-6, 6-4, 3-0 win.
Six men had retired on Monday.
In other early men's action, American number one John Isner breezed past Malek Jaziri of Tunisia 6-2, 6-3, 6-4 on the back of 24 aces and 54 winners.
Czech sixth seed Tomas Berdych, who made the semi-finals in 2012, was also a comfortable winner, seeing off American wildcard Bjorn Fratangelo 6-3, 6-2, 6-4.