According to the Japan Meteorological Agency (JMA), the offshore temblor struck at a latitude of 42.6 degrees north and a longitude of 143.8 degrees east, reports Xinhua news agency.
The quake occurred at a depth of 60 km, the JMA said.
The JMA has not issued a tsunami alert as a result of the quake and no abnormalities were observed at the Tomari nuclear power plant, the only nuclear power plant in Hokkaido. There were no immediate reports of accidents or injuries.