The skyscrapers of the Shinjuku area are pictured as Mount Fuji (L), Japan s highest mountain at 3,776 meters (12,389 feet), looms in the background of Tokyo on May 24, 2023. AFP
The earthquake hit off the coast of the Chiba region, east of the Japanese capital, just after 7 pm (1000 GMT), according to the country's meteorological agency.
Train services were stopped briefly in the area and runways at Narita Airport, an international gateway to Tokyo, were closed temporarily when the jolt hit.
No abnormalities were detected at nuclear plants in the wider region, the national nuclear authority said.
The Japan Meteorological Agency said the quake had a depth of 50 kilometres (31 miles). The US Geological Survey gave it the same magnitude and a similar depth of 44 kilometres.
Moments before Tokyo residents felt shaking, the nation's advance warning system for earthquakes prompted television networks to alert the arrival of a potentially large shake.
"It was like being on a boat floating on water -- sideways rocking that seemed to go on for more than 30 seconds," said a presenter on public broadcaster NHK.
Japan has strict construction regulations to ensure buildings can withstand strong quakes, and routinely holds emergency drills to prepare for major disasters.
In early May, a magnitude 6.3 earthquake struck central Ishikawa region, leaving one person dead and 49 injured.
The country is haunted by the memory of a massive 9.0-magnitude undersea quake off northeastern Japan in March 2011, which triggered a tsunami that left around 18,500 people dead or missing.
The 2011 tsunami also sent three reactors into meltdown at the Fukushima nuclear plant, causing Japan's worst post-war disaster and the most serious nuclear accident since Chernobyl.
Tokyo's population is estimated at around 14 million, with tens of millions more people living in conjoining metropolitan areas including the megacity of Yokohama.
The Japanese capital was devastated by a huge earthquake a century ago in 1923.