Trantor, of Isaac Asimov’s Foundation series, is the seat of government in the Galactic Empire. It’s described as a preposterously dense city-planet home to some 40+ billion people, the pinnacle of human achievement in many ways. The planet is urbanized to such an extent that every inch of it is covered with man-made structure, for it’s necessary to accommodate all of these people. Moreover, it’s even urbanized under the surface with miles of deep tunneling that’s also packed with technological sophistication and activity.
There’s a huge problem, though. Trantor is only slightly larger than Earth, and as such would only possess a population density of 600 people per square mile. That’s not very dense, and it definitely doesn’t require an entire planet being covered in skyscrapers and subterranean development.
This is all just a corny way of pointing out some lovely information by Per Square Mile that shows how much area the world’s population would require at varying levels of density. As you can see, if the entire population of the world lived in a single city at Parisian density, we would all fit in a very small amount of space. Remember, that’s roughly 7 billion people all in an area less than the size of Texas. It’s also important to note that Paris has some relatively strict guidelines that new development must adhere to, including a height limit on buildings which restricts higher densities, so it could be even more dense.
Suffice it to say, the planet Earth can easily seat Trantor’s population, while still allowing for substantial greenery.