Baghdad at sunset. (Karim Sahib/AFP/Getty Images)

Human resources consulting firm Mercer recently crunched the numbers on dozens of factors about life for an expatriate. The aim? To calculate exactly how much extra international firms should be willing to pay their employees when asking them to move to undesirable locations.(While Mercer wouldn't release the precise data, Ed Hannibal, a global mobility leader at the company, said that factors involved included such concerns as security, infrastructure  and the availability of international goods).

While the data has its practical uses, it has another, more viral, function too: Ranking the "best" and "worst" cities for quality of life in the entire world.

For example, it turns out that expats asked to move to Austria are pretty lucky: Vienna ranked top of the list for expats, followed by Zurich, Auckland, Munich and Vancouver. For all of these cities, Hannibal told me, quality of life was so good that companies were recommended to not pay employees there any hardship costs at all.

But down at the other end of the scale, it's a different story. According to Mercer, companies should be willing to pay top dollar for some cities, and none more so than Baghdad.

Yes, the Iraqi capital has beaten out 222 other locations to be named the city with the lowest quality of life for expats in the entire world.

Baghdad is so bad, according to Mercer, that companies should pay people a considerable amount extra to live there. As Hannibal explained to me, companies would likely have to pay an employee an extra 35-40 percent on top of their base salary as compensation for the poor quality of life in Iraq – that some companies might go as high as 50 percent in cash or other services. Worse still, Baghdad is a persistent worst offender in Mercer's data, gradually falling down the rankings since 2001 and ranking last since 2004. It's even acquired the curse of Google Auto-complete: Type "Baghdad Worst" into the search engine, and "Baghdad worst place to live" and "Baghdad worst city" appear.

Could a bustling city of 6 million people really be the worst city in the world? To get a better perspective on it, I reached out to a few Baghdad expats, people who, unlike most Iraqis, made a choice to live in Iraq. Surprisingly, most seemed to be aware that they were apparently living in the worst place they could live.

"I know exactly which survey you mean," said one person who has lived in Baghdad for five years and asked not to be named. "I have often thought of that survey when I take the direct Austrian air flight from Baghdad to Vienna, thereby going from the worst city to the best city in the world in a matter of a few hours."

Others, however, were quick to argue that the poll didn't reflect the Baghdad they knew. "Every expat I know here is mystified by that data," said Jane Arraf, a freelance journalist who has spent many years in the city. "I'd be hard-pressed to find an expat (not a lot of them around admittedly) who believes that's the case, apart from the prisoners of the Green Zone — the embassy people, U.N. staff and others who can't actually get out into the city."

It seems obvious, of course, that Baghdad is a more dangerous place than Vienna: More than 1,000 people were killed in attacks last month, for example. And surely luxury goods would be easier to find in a Western city (when I asked one Baghdad resident about the availability of international goods, they e-mailed back: "hahahahahahahaha").

"In a sense, almost anything an Iraqi could want can be obtained," Raoul Henri Alcala, a private businessman who has lived in the city for 10 years explains, "although often at a high price that also often includes payments to facilitators that can best be described as blatant corruption." 

Alcala, who once worked for the Iraqi government and now runs his own consulting firm, lives in the "Green Zone" and says that while his choice of location is safer than the outside city (the "Red Zone"), his location provides its own difficulties. "Shops do exist in the Zone selling food, beverages, pharmaceuticals and minor comfort items," Alcala says. "Everything else has to be purchased outside, and can be brought into the Zone only after a laborious written authorization is requested and received." Popular restaurants, markets  and liquor stores outside the Green Zone have become targets for terror attacks, according to Alcala.

Alcala says that he has never lived in a city with a comparable "level of uncertainty and difficulty." There do appear to be rivals, however, for Baghdad's "worst city" crown. In the Mercer data, it  narrowly beats out Bangui in the Central African Republic, Port-Au-Prince in Haiti, N'Djamena in Chad and Sana'a in Yemen. Plus, there are more than 223 cities on Earth. It's plausible that one of these unlisted locations is "worse" than Baghdad (and, for what it's worth, rival data from the Economist Intelligence Unit states that Damascus was the worst place in the world to live).

Baghdad's place at the bottom of the list is a little more depressing when you consider that much of the lack of infrastructure and chaotic security situation can at least partially be blamed on eight years of U.S.-led war (the U.S. government has spent $60 billion in civilian reconstruction to be fair, though much of it is thought to have been wasted). That weight must affect some expats in Baghdad: One told me that she "felt a sense of responsibility to clean up the mess that George Bush made." On the other hand, others explained that the potential for personal remuneration was likely a serious motive for many expats.

Ultimately, people who choose to live in a place like Baghdad probably do so for a complicated set of reasons. As Arraf puts it, there are two types of people in the world:  The "you couldn't pay me enough to do this" types, and the "I can't believe I'm getting paid to do this" types. The latter should probably ignore Mercer's data.