The quake shook buildings in the capital, Taipei. The quake had a depth of 10 km (6.2 miles), the weather administration said.
Earlier this month at least 14 people died after a 7.2 magnitude earthquake hit Hualien and Taiwan has been jolted by hundreds of aftershocks since.
Taiwan lies near the junction of two tectonic plates and is prone to earthquakes.
More than 100 people were killed in a quake in southern Taiwan in 2016, while a 7.3 magnitude quake killed more than 2,000 people in 1999.