Swiss 17-time Grand Slam champion Federer, who swept the New York hardcourt crowns from 2004-2008, dispatched Argentina's 48th-ranked Carlos Berlocq 6-3 6-2 6-1 in 95 minutes, firing six aces and 37 winners.
"I was pretty comfortable out there," Federer said. "So that was a good sign."
Federer, at his lowest US Open seed since 2002 at seventh, advanced to a matchup with either US 26th seed Sam Querrey or Frenchman Adrian Mannarino.
"Just keep on winning. I don't care how," Federer said of his goals. "Right now it's about winning for me, trying to gain confidence and enjoy myself. I hope I can progress. We'll see how it goes."
Also Read
Federer and Spanish second seed Rafael Nadal, a 12-time Grand Slam winner who captured his eighth French Open crown in June, could meet for the first time at the US Open in this year's quarter-finals.
Nadal, unbeaten this year on hardcourts and a US Open favorite, makes his bid for a third-round berth later against Brazilian qualifier Rogerio Dutra Silva.
Spanish fourth seed David Ferrar and French eighth seed Richard Gasquet kept rolling toward a potential quarter-final matchup of their own.
Ferrer dispatched compatriot Roberto Bautista Agut 6-3 6-7 (5/7) 6-1 6-2 while Gasquet also ousted a countryman, dumping Stephane Robert 6-3 7-5 7-5.