The quake struck at sea at 9:37am (0807 IST) some 34 kilometres below ground, Indonesia's metereology and geophysics office said in a brief telephone text message.
There were no reports of damage or injuries and there was no tsunami alert. The US Geological Survey put the quake at strength of 6.4.
The quake's epicentre was nearly 160 kilometres southwest of the town of Painan in West Sumatra province.
Sumatra's western coast has been repeatedly jolted by strong earthquakes since last month.
On Feburary 20, a 7.5-magnitude quake rocked Aceh province, at the tip of Sumatra, killing three people and seriously injuring 25 others on the remote island of Simeulue.
The sprawling Indonesian archipelago sits on the so-called Pacific Ring of Fire where continental plates collide, causing frequent and volcanic activity and earthquakes.
Indonesia was the nation worst hit by the Indian Ocean tsunami in December 2004, which killed some 168,000 people in Aceh alone.