The Meteorological Agency said the quake was centered in Chiba prefecture, just east of Tokyo, at a depth of 48 miles.
It caused buildings to sway but there were no immediate reports of damage or injuries.
NHK public television showed a sign hanging from the ceiling in its office swaying violently. Power lines shook in Tokyo’s Suginami district.
Shinkansen super express trains in and out of Tokyo were temporarily halted, NHK said.
Video taken in the busy downtown districts of Shibuya and Shinjuku showed cars moving and people walking on the streets as usual.
New Prime Minister Fumio Kishida posted a message on Twitter urging people to “check the latest information and take action to protect your lives.”