Canmore is the least affordable place to buy a home in Alberta while Fort McMurray is the most affordable, according to a recent analysis of housing prices and incomes in two dozen cities and towns across the province.

Real estate company Zoocasa arrived at that conclusion by comparing average housing prices in 24 real-estate markets to median incomes in those local areas.

Canmore's average home price of $676,093 was 12.9 times the median income for a single-person household in the mountain town, and 5.8 times that of a two-person household.

That gave Canmore the highest price-to-income ratio of all the real estate markets studied.

At the other end of the spectrum was Fort McMurray.

Average home prices in the Nothern Alberta city rung it at $439,664, which was on the higher end. But median incomes in the oil-rich area were the highest in the province at $106,912 for single people and $221,425 for a two-person household.

That gave Fort McMurray the lowest price-to-income ratios in the province, at 4.1-to-1 for singles and 2-to-1 for two-person households.

These 24 real-estate markets were ranked for affordability based on the ratio of average prices to median incomes in each area. (Zoocasa)

Penelope Graham with Zoocasa, an online real-estate brokerage, said the company has done similar analyses of housing markets in other provinces and what stood out about Alberta was how many towns and smaller cities fell into the traditional definition of "affordable."

A rough rule of thumb among personal finance advisers has been to limit the purchase price of a home to three times your gross household income.

Average prices in most of the cities and towns studied in Alberta (13 of 24) fell into that category for two-person households, including Fort McMurray, Cold Lake, Grande Prairie, Fort Saskatchewan, Airdrie, Lloydminster, Sylvan Lake, Spruce Grove, Beaumont, Lethbridge, Stony Plain, Leduc and Medicine Hat.

"To put some perspective on that," Graham said, "when we did a similar study for British Columbia, only two markets were even close to being considered affordable."

She cautioned, however, that the analysis offers a snapshot of housing prices in each market, as a whole, and doesn't necessarily mean that no affordable housing is available in a particular area.

"This is a study of the aggregate averages for these city centres, as a whole," she said. "But it's really important that home buyers understand that real estate pricing is extremely local and it can vary from neighbourhood to neighbourhood."

The housing price data came from local real estate boards while the income data came from Statistics Canada.

Read more articles by CBC Calgary, like us on Facebook for updates and subscribe to our CBC Calgary newsletter for the day's news at a glance​