Fantasy and sci-fi are replete with underground cities: Ember, Zion, Menzoberranzan, Khazad-dûm and more. But are there any caves on Earth that are large enough to actually contain a real, functional city?

Earth's crust is riddled with massive underground spaces. There are so many that humans will probably never find them all, even though we're constantly finding new ones. In aggregate, there's certainly enough space underground to house a serious chunk of the human population. But can we find a single space large enough to house a respectable city?

The world's largest known cave system is Mammoth Cave in Kentucky. The explored and surveyed part of the system adds up to more than 300 miles of caves. The largest single chamber within Mammoth Cave is Chief Temple, 150m x 100m x 40m high. That's impressive (and I highly recommend you make a trip to Mammoth Cave some day), but it's nowhere near the largest chamber in the world.

Within a cave called Gua Nasib Bagus on the island of Borneo is Sarawak Chamber. It's 700m long, 400m wide and 70m high. When it was discovered in 1981, the explorers had no concept of how big it was, because their lights couldn't reach far enough to find the walls. Even today, after the chamber has been measured by lasers, there are few good photos of it because it's just too huge and dark.

Then there's Hang Son Doong. This cave in the jungle of Vietnam extends more than two miles. It isn't a single chamber like Sarawak, and it's obviously not as extensive as Mammoth Cave, but over the course of that two miles, Hang Son Doong encompasses a massive volume, 100m wide in places and 200m high. It's so huge that, beneath massive 100m skylights, it contains entire underground jungles nourished by sunlight glimmering down from the surface.

Now we have some idea of how large caves can get, so let's do some calculations on city size and population density. Sarawak Chamber is only 0.28 km2 (actually less because it has an irregular shape). Hang Son Doong, if we assume ideal uniform dimensions (which is certainly does not have) is somewhere around 0.4 km2.

The most densely populated cities in the world, like Mumbai and Chennai, achieve population densities of 20,000 per square km. With its height of 200 m, Hang Son Doong would not be able to fit any of the tallest 300 skyscrapers in the world, a considerable setback. Even if we assume that the cave could somehow manage a population density comparable to Mumbai, that still only amounts to 8,000 people. Not exactly a bustling urban center. Then again, 8,000 people living in a single giant cave would still be pretty amazing.

How does this compare to fictional underground cities? Zion from the Matrix series held upwards of 250,000 people, but it was actually a series of large caverns. Menzoberranzan, a drow city within D&D's Forgotten Realms campaign setting, is home to over 30,000 individuals (both dark elves and slaves), and it's contained within a single chamber in the Underdark that‘s roughly 4 km2 in area. Zion is plausible given that the Machines likely altered or constructed the caverns to house the humans, and Menzoberranzan maintains a logical level of population density, but is a far larger chamber than any cave on Earth.