Cities that vie to host the Olympics know being chosen involves a big cash outlay to make the events happen in the grand fashion expected.

But just how much money is involved?

London, which is hosting the upcoming summer festivities, will drop a cool $40 million, but that still falls shy of the $43 million Beijing spent in 2008.

Hosting the Games isn’t cheap, but cities recoup much of their investment in advertising revenues and tourist dollars. And it doesn’t just last for the duration of the events — for years afterward, host cities and countries often continue to promote themselves as such to keep the money flowing.

That said, while the venues typically built for Olympic events can continue to be used long after everyone goes home, sometimes cities find they have no use for them or that the cost of maintaining them outweighs any income they might generate. Other cities have much lower initial costs because the necessary infrastructure is already in place.

Fortune recently reviewed the money shelled out by host locales since 1988, taking into account both public and private costs, legacy, and infrastructure investments. Here’s how much the cities spent (or estimate they’ll spend), from highest to lowest. Note all Games listed are for the Summer Olympics.

1. Beijing (2008) – $43 billion
2. London (2012) – $40 billion
3. Barcelona (1992) – $15 billion
4. Athens (2004) – $14 billion
5. Seoul (1988) – $8 billion
6. Atlanta (1996) – $7 billion
7. Sydney (2000) – $5 billion
8. Los Angeles (1984) – $1 billion

[Fortune]