O'Sullivan, who last won the Shanghai Masters in 2009, beat compatriot Hawkins in five straight frames. O'Sullivan's highest break was 90, in the fourth frame. He also rattled off 51, 87, 78 and 67.
Hawkins didn't even come close to a fightback against the current world no.7, managing a highest score of 42 in the fifth and final frame.
Superb plant from O'Sullivan against Hawkins
Scotland's John Higgins, who last year exited in the second round of the tournament, knocked out Liang Wenbo 5-2.
This year's European Masters winner, Judd Trump, also made the quarter-finals with a 5-0 win over Stephen Maguire.
There was an upset for last year's tournament runner-up Mark Selby, who lost by three frames to five to Mark Williams, who reached the semi-final of the Riga Masters earlier this year.
O'Sullivan will meet WIlliams in the quarter-final later on Thursday.
Shanghai Masters Round 3 Results
Mei Xi Wen 2-5 Kurt Maflin
Mark Allen 4-5 Jack Lisowski
Graeme Dott 4-5 Luca Brecel
Stephen Maguire 0-5 Judd Trump
John Higgins 5-2 Liang Wenbo
Martin Gould 5-2 Marco Fu
Barry Hawkins 0-5 Ronnie O'Sullivan
Mark Williams 5-3 Mark Selby
Fluke plant helps Hawkins against O'Sullivan
O'Sullivan edges astonishing tension-packed frame