Second seeded Federer, bidding to become the first man to win eight Wimbledon titles and take his majors tally to 18, enjoyed a 67-minute 6-1, 6-3, 6-3 win over Damir Dzumhur of Bosnia, the world number 88 he beat at the French Open this year.
Federer will face Sam Querrey of the United States for a place in the last 32.
"I was happy I played aggressive," the 33-year-old Swiss said.
"I was always going to miss playing that way a little bit but also he hung around," he said.
"He changed up his game a little bit which made it a little bit more difficult so it was interesting for me. But I'm very happy, always, to win like that."
Nadal, defeated in the second, first and fourth rounds in the last three years, reached the second round with a 6-4, 6-2, 6-4 win over Thomaz Bellucci, his fifth win in five meetings against the 42nd-ranked Brazilian.
Tenth-seeded Nadal, his lowest ranking for a decade, faces Germany's Dustin Brown for a place in the last 32.
Defending women's champion Petra Kvitova, the second seed, took just 35 minutes to reach the second round, cruising to a 6-1, 6-0 win over Kiki Bertens, the world number 108 from the Netherlands.
Kvitova, also the 2011 champion, dropped just one point on serve and next meets Kurumi Nara of Japan for a place in the last 32.
"It's great to be back on Centre Court and unbelievable to see all the people clapping," said the Czech, who had been laid low by illness in the week before the tournament.
Kvitova's only dropped point on serve came on a double fault in the final game of the match.
The powerful 25-year-old left-hander would have been relieved to have enjoyed a brief first round outing as temperatures rocketed to around 30C.
Wednesday is expected to see a Wimbledon record high of around 35 degrees which would require the heat index, where matches are briefly suspended, to be consulted.
Organizers say the heat rule, which allows for a ten-minute break between the second and third sets of women's matches, can be used when temperatures rise above 30.1C.
However, the rule which has been adopted by Wimbledon after lobbying from the WTA, does not apply to men even though they have to slug it out over the best of five sets.
The highest-ever temperature recorded at Wimbledon was 34C in 1976.
Nadal, who lives in sun-kissed Mallorca, said he would be happy to see the sun keep shining.
"In Australia it can be much, much worse so it's no comparison but actually it's beautiful," said the Spaniard.
"When you have this weather here in Wimbledon it's probably one of the best places in the world."
French 13th seed Jo-Wilfried Tsonga was probably wishing for a few clouds after he spent more than four hours to see off Luxemburg's Gilles Muller 7-6 (10/8), 6-7 (3/7), 6-4, 3-6, 6-2.
Joining Kvitova in the second round was tenth seeded German Angelique Kerber who handed compatriot Carina Witthoeft a 6-0, 6-0 drubbing.
Kerber, a semifinalist in 2012 and who won the Birmingham tournament on grass in the run-up to Wimbledon, took just 45 minutes to clinch victory, firing 21 winners past the world number 53.
It was the third so-called "double bagel" result of the women's first round.
Later Tuesday, 2013 champion and home favourite Andy Murray takes a 2-0 career lead over world number 59 Mikhail Kukushkin into their opener on Centre Court.
Like Murray, Kukushkin is coached by a woman — his wife Anastasia.
Murray beat his rival twice in 2012 at Brisbane and then at the Australian Open in the fourth round.
That remains Kukushkin's best run at a major although he did reach the third round at Wimbledon in 2014, when he lost to Nadal.