The quake had epicentre at 18 km northeast Pidie Jaya district and the depth at 10 km under land, Xinhua news agency quoted an official of the meteorology and geophysics agency as saying.
While no tsunami warning was issued, the powerful earthquake caused heavy structural damage, with reports of casualties coming in.
In June a 6.5-magnitude quake struck off the west of Sumatra damaging scores of buildings and injuring eight people. Indonesia experiences frequent seismic and volcanic activity due to its position on the Pacific "Ring of Fire", where tectonic plates collide.
Sumatra is particularly prone to quakes.
Aceh province on the tip of the island was devastated by the quake-triggered tsunami in 2004 that killed more than 170,000 people in Indonesia and tens of thousands more in other countries around the Indian Ocean.