Canada's biggest cities ranked ahead of most U.S. cities in Mercer's annual global quality of living survey, with the human resources company crediting high levels of personal safety that exist in Canada.

Vancouver is the highest Canadian city on Mercer's global list of 230 cities — in fifth place overall — the same ranking as last year.

Vienna, Zurich, Auckland and Munich were the only cities that placed ahead of Vancouver. Baghdad, ranks last.

Other Canadian cities fared well in the Mercer survey, with Toronto (15th), Ottawa (17th), Montreal (23rd), and Calgary (32nd) all in the top 50 cities worldwide. San Francisco was the top U.S. city, in 28th place.

This year's survey was the first to factor personal safety into the calculations, joining other categories like economic conditions, medical and health issues, the social and cultural environment, education, housing and recreation.

It's worth noting that the housing category evaluates rental housing prices, as opposed to how much it costs to buy. Vancouver is the most expensive real estate market in Canada.

"Quality of living continues to be high in Canada with a stable political environment and positive social benefits, offering a very desirable and safe place to live and work for residents and expatriate employees," said Gordon Frost, leader of Mercer's talent business in Canada, in a statement.

Canadian cities 'much safer'

The survey ranks only five Canadian cities. It places all five at 16th in the world for personal safety. No American cities place in the top 50 worldwide.

"Canada's major cities continue to be much safer than every U.S. counterpart," Frost said. "This is extremely appealing for expatriate employees looking to bring their families with them as they move abroad for work."

Mercer's survey is designed so multinational companies can come up with appropriate compensation when placing employees on international assignments.

The company says most multinationals provide a quality of living or "hardship" allowance for staff to compensate for a decrease in the quality of living between their home base and the new location.

Global quality of living rankings

Vienna. Zurich. Auckland. Munich. Vancouver. Dusseldorf. Frankfurt. Geneva. Copenhagen. Sydney, Australia.

Source: Mercer