Sending children to private school can cost parents less than buying a house near the best local authority-run schools, a think tank has claimed.
A study by Reform Scotland found high house prices in the catchment areas for the best-performing state schools meant moving there could be more expensive than private school fees for two youngsters.
The think tank said that of the top ten performing schools, with the highest proportion of pupils getting three or more highers, eight of these had house prices at least 34% higher than the local average in their catchment area.
It added for the ten worst-performing schools, eight had property prices below the local average in their catchment area, while in six house prices were at least 20% lower.
Reform Scotland said it " became apparent that, especially in more urban areas, it cost parents less to send two children to a private secondary school and live in a less expensive area of the local authority, than to buy a house in the catchment area of one of the best-performing schools in the area".
While the average price paid for a house in Edinburgh over the last three years was said to be £225,931, this rose to £327,313 in the postcode area of Boroughmuir High School - where 64% of fourth-year pupils passed at least five standard grades last year, compared to 38% across Scotland.
With properties in this area £101,382 more expensive than the average in the capital, it could cost house buyers £127,000 to borrow this extra amount at a competitive mortgage rate .
Reform Scotland said it would cost approximately £123,000 to send two children to a private school - such as George Heriot's or George Watson's in Edinburgh - for six years of secondary education.
The think tank concluded: " We believe that this clearly indicates that to access the best-performing schools in Scotland, parents are paying for the privilege -either directly through school fees, or indirectly through higher housing costs.
"The high house prices around the most academically successful schools can mean it is cheaper to live in a less expensive area and send your children to a private school, than it is to live in the catchment area of one of the best academically performing schools."
Keir Bloomer, a former council education director who has been involved in curriculum reforms north of the border, said the research showed that "Scottish education remains highly inequitable".
Mr Bloomer is a Reform Scotland advisory board member and chaired the Commission on School Reform, which was set up jointly by Reform Scotland and another thinktank, the Centre for Scottish Public Policy.
He said: "This is not about 'good schools' and 'bad schools', but about our failure to tackle disadvantage effectively.
"Until effective action is taken, parents will quite naturally try to buy educational success."
In March, the Commission on School Reform recommended s chools should be given greater autonomy, including the power to spend their budgets '"without strings attached''.
In a report looking at the future of Scottish education it argued that f undamental changes are needed to empower schools and better serve pupils from disadvantaged backgrounds.
It recommended a shift in the role of local authorities, saying in many cases they were too involved with the day-to-day management of schools.
The commission argued such a shift could give headteachers greater control over a range of areas including leverage to recruit and retain talented teachers to work in deprived areas by offering financial incentives.