Madrid qualified 5-2 on aggregate, but it was Ronaldo's third goal in the 87th minute at Santiago Bernabeu Stadium in the second leg that put the result of the last-16 match beyond doubt.
It was Ronaldo's third hat trick this season and the 18th of his Madrid career, but his opening goal in the third minute was the pick of the three. The unmarked Portugal forward struck a powerful, swerving shot from distance that gave goalkeeper Sergio Alvarez no chance, with the ball nestling inside the far side-netting.
"The team wasn't comfortable and that first goal that Cristiano hit like something else left even me applauding," Celta coach Paco Herrera said.
Ronaldo made it 2-0 when he raced through the middle, beating the offside trap to latch onto a chipped pass from midfielder Luka Modric and divert the ball into the net in the 24th.
Ronaldo completed his hat trick on a counterattack, finishing adroitly after combining with Gonzalo Higuain. The Bernabeu erupted with chants of "Ballon d'Or," a reference to the title Lionel Messi won for the fourth time earlier this week.
"Let's hope Cristiano Ronaldo carries on like this. They are going to be four or five hard months ahead of us," said Higuain, referring to the upcoming Champions League clash against Manchester United and the 16-point gap to leader Barcelona in the Spanish league.
Sami Khedira scored the fifth goal in the 89th minute, while Madrid defender Ramos was sent off in the 73rd after receiving a second yellow card for fouling Alex Lopez.
The game began with fans cheering the selection of goalkeeper and captain Iker Casillas, who was in the starting line-up for the first time in three matches after having been contentiously dropped. Somewhat surprisingly, coach Jose Mourinho also received a good reception when his name was read out over the speaker system.
Ronaldo had a goal disallowed for offside in the 37th minute, a decision that appeared incorrect and enraged Mourinho. The coach was also furious when Ronaldo was fouled on the edge of the box, picking up a loose ball and kicking it into his own dugout.
"Sometimes people aren't happy with the coach but we are still in the Champions League and in the Copa -- we could even win the league," Ronaldo said.
Earlier, Sevilla also advanced to the last eight by winning 6-2 on aggregate against Mallorca despite losing 2-1 at home in the return leg.
The hosts took the lead through Manuel del Moral in the 22nd minute, the forward tapping the ball in from close range after Juan Torres had failed to score from a corner.
In another goalmouth scramble, Brandon Tomas found the net in the 51st minute to level for Mallorca and make up for teammate Tomar Hamed's unsuccessful attempt.
Bosnia winger Miroslav Stevanovic made his debut for Sevilla at the start of the second half.
Also, Zaragoza beat 10-man Levante 2-0 to go through 3-0 on aggregate.