The quake struck 32 km southwest of a town in the northern Thai city of Chiang Rai on the Myanmar border, Thailand's Meteorological Department said.
Severe shaking was also felt in Myanmar's largest city Yangon.
There were no reports of casualties, but the quake caused damages to buildings, roads, sources of energy and communication systems in a 24-kilometre radius, Bangkok Post reported.
The Wat Rongkhun, a well-known temple near the city, was closed after the spire of the main building came off and the tiles on the roof fell off.
Also Read
The Chiang Rai airport evacuated people from its terminal after display signs and pieces of the ceiling fell.
People in the North posted on social media that the shake was noticeable and merchandise fell from shelves at local shops and department stores.
Ceiling tiles fell at Chiang Rai airport and passengers immediately ran out of its passenger terminal. Netizens posted pictures of big cracks on buildings and roads and a broken Buddha image in Phan district, Chiang Rai.
"People living in three storey buildings got dizzy," said Jane Suchada, a resident of Chiang Mai, which neighbours Chiang Rai.
In Bangkok, residents in high rise condominiums felt the powerful quake.
Several residents quickly went downstairs with their children while others were confused and stayed back.
A 73-year-old Indian tourist B Rukmini here said she gripped the door for support as she thought she was having a dizzy spell.
The earthquake affected buildings, roads, sources of energy and communication systems in a 24-kilometre radius which covers Phan, Muang Chiang Rai, Mae Lao, Mae Suai and Wiang Pa Pao districts. Aftershocks are expected, the report said.
Thailand does not sit on a major fault line in the continental shelves, so it rarely experiences powerful quakes.