Toronto and Montreal are the world's two best places in the world to live, the Economist says, citing a range of measures including safety, livability and cost.

The ratings are included in the Economist Intelligence Unit's latest safest cities index, in which Toronto and Montreal rank first and fourth, respectively, for safety among North American safest cities.

For its overall best-places-to-live rating, the Economist used an "index of indexes," pulling together its city rankings for safety, livability, cost of living, environment, democracy and food security.

On that basis, Toronto and Montreal topped all 50 cities that were measured, ahead of Stockholm, Amsterdam, San Francisco and Melbourne, Australia.

In the safest cities index, the two Canadian centres shared North American rankings with New York (No. 2), San Francisco (No. 3), and Chicago, Los Angeles, and Washington (No. 5 through 7).

Worldwide, Toronto ranked eighth and Montreal 14th in safety.

The world's safest city was also among the most populous: Tokyo. At the bottom was Jakarta, Indonesia, at No. 50.

Montreal ranks as North America's fourth-safest city after San Francisco, according to the Economist list. (Wikimedia)

The safest cities ranking focused on four categories:

Digital security (privacy, level of technology).

Health security (environment and access to health care).

Infrastructure safety (enforcement of transport safety, pedestrian friendliness).

Personal safety (policing, street-crime levels).

Designing cities

Civic design also plays a role.

"Cities can use intelligent design and carefully considered city layouts to reduce the threat of violent crime or terrorist attacks, while creating an urban environment that is visually attractive and easy for everyone, from pedestrians to cyclists, to navigate," the report said.

"Modern cities are presenting increasingly complex safety challenges," the Economist report says. "New threats demand new approaches."

Ultimately, it concludes, safe cities are the ones that can support vibrant culture and a "dynamic entrepreneurial environment."

The EIU is an independent business of London-based The Economist Group, that provides forecasting and advisory services as part of its research work.