The scores, 4-6, 6-3, 7-5, 6-4, sent the reigning five-time men's Open champion into the tournament's second week for the sixth straight year, despite 59 unforced errors.
"I don't make it easy all the time, but I try to play my best," Federer told New York Newsday after his 14th win in a row over Hewitt.
He has not lost at the Billy Jean King National Tennis Center since 2003.
In another early men's match, No. 15 Radek Stepanek beat 23rd-seeded Philipp Kohlschreiber 4-6, 6-2, 6-3, 6-3.
Also scheduled to play Saturday were fourth-seeded Novak Djokovic, No. 5 Andy Roddick and eighth-seeded Nikolay Davydenko.
Copyright 2009 by United Press International.