The epicenter of the quake was in the Pacific Ocean off the coast of Japan's main island, Honshu, at a depth of about 6 miles.
There were no immediate reports of damage, but residents in most of the northeastern coastline were warned to evacuate.
Officials predicted a tsunami of up to 20 inches, but the initial waves were only about 4 inches.
Japan's northeastern coastline was devastated by an earthquake and tsunami on March 11 that left nearly 23,000 dead or missing and touched off a nuclear crisis at a badly damaged facility in Fukushima.
The Associated Press contributed to this story