In both cities, the average home sells for just over five times the amount of the typical salary - one of the lowest ratios in the country.
In Dundee, a typical home costs £117,000, while average salaries are £22,399 - meaning that the cost of a home is just 526 per cent of earnings. In Glasgow, a house is 5.26 the average salary of £22,325. In Edinburgh, however, the typical home cost 10.15 times the average earnings in the city.
Overall, average property prices in Scotland are 6.81 times the typical salary - the third most affordable are of the UK - according to the report from Comparethemarket.com.
The highest ratios came in London and Oxford, where prices are more than 15 times the average person’s income.
Stoke on Trent boasts the lowest ratio of all of the cities analysed, at 4.98. All of the other cities and towns in the top ten for affordability were in the north of England.
Chris King, head of home insurance at comparethemarket.com, said: “When it comes to house price affordability in the UK it will come as little surprise that regional variations are dramatic. Scots can take some comfort that two Scottish cities, Dundee and Glasgow, feature in the top 10 most affordable places to buy a home when the average salary is taken into account Scotland’s picturesque capital fares less favourably in affordability rankings, with the price of the average property coming in at 10.15 times earnings."
The study analysed cities with a minimum population of 100,000, using median salary data from the Office for National Statistics and property date from the Land Registry.
The report said: “When looking at each city, we were able to divide them into their regions so we could find out which parts of the country offered the most and least affordable housing in the UK. We were able to work out an income to house price ratio with the data, then took an average of these for each region.”