It was centered 28 kilometers (17 miles) northwest of Sinabang town of North Sumatra province at a depth of 45 kilometers (28 miles), according to the U.S. Geological Survey. The quake hit at 7:27 a.m. local time (0027 GMT).
Suharjono from Indonesia's meteorology and geophysic agency said the earthquake had no potential to generate a tsunami. He said an earthquake that close to the coast would have to be more powerful to generate a giant wave.
Indonesia is prone to earthquakes because it is in the so-called Pacific Ring of Fire. A magnitude 9.2 earthquake in 2004 triggered a tsunami in the area that killed 230,000 people.
Get Eyewitness News Delivered