"Madison is a great young player and it was very tough," said Kerber, a semifinalist last year at Wimbledon. "So happy I won today on my birthday!"
The 17-year-old Keys was playing in the main draw for only the second time at the Australia Open.
Fourth-seeded Angieszka Radwanska, meanwhile, won her 12th match in a row with a 6-3, 6-1 victory over Britain's Heather Watson on the second of the show courts at Melbourne Park.
Radwanska won tournaments in Auckland and Sydney before coming to Melbourne.
"I'm extremely happy to be playing my best tennis from the beginning of the year," Radwanska said. "Hopefully I'll play on the same level the rest of the tournament."
Sixth-seeded Li Na also advanced to the fourth round with a 6-4, 6-1 win over Sorana Cirstea of Romania.
Li will next play Julia Goerges of Germany, who beat Zheng Jie 6-3, 1-6, 7-5 earlier Friday.
After soaring to 106 degrees on day four, the temperature dropped into the mid-70s on Friday, and light rain briefly interrupted play on some courts.
Roger Federer has won four Australian Open titles among his 17 majors, and is ordinarily one of the most popular athletes in Australia.
The only problem is this: His 6-3, 6-4, 6-4 win over Nikolay Davydenko on Thursday night set Federer on course for a third-round match against Bernard Tomic, the last remaining Australian in the men's or women's draws.
The 20-year-old Tomic beat German qualifier Daniel Brands 6-7 (4), 7-5, 7-6 (3), 7-6 (8) in the last afternoon match on the center court at Melbourne Park, keeping his cool on a long, searing day.