Almost a quarter of families with children who stay in council or housing association homes live in overcrowded circumstances, according to new figures.

The latest 2011 census data shows families in 23% (33,000) of social rented properties do not have enough space.

The figure falls to 17% (13,000) for families with children living in private rented accommodation.

Across all of Scotland's 2.4 million homes, overcrowding was an issue in 9% of homes, or 214,000 properties.

Lack of space was found in 5% of owner-occupied property, 16% of social rented accommodation and 17% of private rented homes.

Overcrowding soared in student properties, homes with more than two generations of a family living together and households of unrelated adults.

In private rented accommodation, just over a third (35%) of these properties were overcrowded, increasing to 43% in social-rented homes.

The census also reveals that 5% of overcrowded households had no central heating in 2011.

Graeme Brown, director of Shelter Scotland, said: "This is a shameful situation and yet another consequence of the housing crisis in Scotland today.

"A lack of investment in social housing over the last three decades and the impact of Right to Buy, with more than half a million social homes sold off, all add up to a major shortage of affordable housing.

"These are just some of the compelling reasons we need to see at least 10,000 homes for social rent being built each year to tackle Scotland's housing crisis.

"Unfortunately, however, in the most recent Budget statement, the Scottish Government committed to delivering just 4,000 homes for social rent next year, less than half of what we need.

"This was a real missed opportunity and, at that rate, we will never meaningfully address the shortage of affordable homes in Scotland and give hope to those families in overcrowded homes."

A spokeswoman for the Scottish Government said it assessed overcrowding using the Scottish House Condition Survey, a different approach from that used in the census.

She said: "The 2012 survey showed that 4% of households in social rented housing were overcrowded.

"People living in overcrowded houses are a priority for the allocation of social housing and this is protected in legislation.

"We have boosted housing supply budgets by investing £1.7 billion in affordable housing over the lifetime of this parliament.

"Through our partners in councils and housing associations, we have now delivered more than 21,000 affordable homes and are two-thirds of the way towards our target of 30,000.

"This Government has delivered more social housing than any previous administration. We have delivered over 4,000 new council houses since 2009 and are committed to preserving Scotland's social housing stock by abolishing the Right to Buy, which will protect up to 15,500 social houses from sale and safeguard social housing for future generations."