Federer -- a five-time champion at the tournament -- beat Japan's Yoshihito Nishioka 6-2, 6-2, 6-4 on a sweltering day at Arthur Ashe Stadium. The two-time U.S. Open champion outlasted the heat and Hungarian Marton Fucsovics. The Serbian won his match 6-3, 3-6, 6-4, 6-0.
No. 4. Alexander Zverev and No. 7 Marin Cilic also advanced into the round of 64. Federer faces France's Benoit Paire in the next round. Djokovic battles American Tennys Sandgren on Wednesday in the same round.
On the women's side, Caroline Wozniacki ousted Australia's Samantha Stosur. No. 5 Petra Kvitova beat Belgium's Yanina Wickmayer. No. 4 Angelique Kerber beat Russia's Margarita Gasparyan. No. 6 Caroline Garcia beat the United Kingdom's Johanna Konta and No. 10 Jelena Ostapenko beat Germany's Andre Petkovic.
No. 3 Sloane Stephens faces Anhelina Kalinina at noon on Wednesday, while No. 3 men's player Juan Martin del Porto takes on American Denis Kudla. No. 1 Rafael Nadal takes on Vasek Pospisil on Wednesday night in the round of 64.