The epicentre of the earthquake was in the Soya region of the northern island of Hokkaido, and at a depth of 3 kilometres, the National Research Institute for Earth Science and Disaster Reliance (NIED) said.
No tsunami warning had been issued, broadcaster NHK said. There were no immediate reports of damage.