The epicentre was very shallow at just 1km, the US Geological Survey said. No tsunami warnings have been issued.
The hotel that collapsed is located in the coastal city of Hualien. Emergency services were working to free them.
Two bridges in Hualien City were damaged and sealed off from the public.
A pedestrian walks on a main road as the Yun Tsui building leans to one side
At least 28 people have been rescued so far from buildings that have at least partially collapsed, the Hualien fire department said.
Don Blakeman, a geophysicist at the National Earthquake Information Center, says the temblors have continued into the early morning hours on Wednesday.
A huge building was filmed collapsing during the quake, narrowly missing a lucky taxi driver.
Antonio Conte assesses condition of January deadline day signings
I heard Antonio Conte quite likes me as a player but I was only ever concentrating on Stoke. He played only last season with Roma, and played very well.
Tuesday night's quake follows one over the weekend off the coast of Hualien on the east of Taiwan, which lies along the famed "Pacific Rim of Fire" known for seismic activity from Alaska to Southeast Asia.
A woman leaves the damaged Marshal Hotel in Hualien, eastern Taiwan, after a strong quake. A magnitude 6.1 natural disaster struck in the area two days ago and another quake, measuring 5.3, hit the same area later that day, Reuters reported.
As soon as the quake struck, Clarke and her friends jumped out of their beds and ran outside straight to the hills. No one was killed in those quakes.
To Instagram, Snapchat, WhatsApp
The technology essentially uses Google's computational photography and machine learning to improve photo quality. Pixel Visual Core can now make images taken in those third-party apps brighter, more detailed, and clearer.
"We didn't really know what to do", Ms Clarke told TVNZ 1's Breakfast. Another clip shows the damage caused inside a store. "I wouldn't be surprised for there to be a number of aftershocks in the next couple of days".
Espanyol vs Barcelona: Boss makes big statement ahead of crunch clash
This season, above any other in his career, Gerard Pique has had to deal with the brunt of opposition supporter terrace ire. After the equalizer, Pique celebrated by putting a finger in front of his mouth as if to tell the crowd to be quiet.