8,000 people are currently locked up in Scotland's jails
Scotland's prison system is failing the public, prisoners and staff, according to the chief inspector of prisons.
Dr Andrew McLellan told BBC Scotland that overcrowding, with inmates at an all-time high, was making Scotland a more dangerous place.
Scotland's biggest prison, Barlinnie, is running at 50% over capacity, but Dr McLellan insisted building more jails was not an option.
The justice secretary said fewer minor offenders should be locked away.
The majority of Barlinnie's 1,500 inmates share cells - a situation which is mirrored around the country.
With the country's prisons designed to hold 6,000 inmates, about 8,000 are currently locked up.
Dr McLellan said jails were "bursting at the seams".
He added: "[In one night] the prison population of Scotland rose by 1%.
"If you were to have that same rate of growth regularly, you would fill a new prison in a fortnight - you would need to build 26 prisons in a year."
A rise in the number of short-term offenders has been partly blamed for overcrowding.
Dr McLellan said those jailed for six months or less did not receive any rehabilitation and more were likely to re-offend.
He added: "Overcrowded jails mean Scotland is less safe, for the sake of us all we need to make sure overcrowding is defeated."
He wants measures other than short custodial sentences for offenders to be considered.
Justice Secretary Kenny MacAskill has already sanctioned three new jails for Scotland, but he said he agreed with Dr McLellan's view.
He said: "We have far too many people who are not a danger to the community, who are petty offenders and who we need to punish in the community - not lock up and make the job of the prison service more difficult."
Mr MacAskill said he wanted to see only the most dangerous prisoners locked away but he conceded that changes in attitudes would be needed first.
He told BBC Radio's Good Morning Scotland programme: "Clearly there are dangerous people in Scotland, we have to lock them up and we have to do so for the safety of our communities.
"However, we cannot properly work on those dangerous people if we have a prison system that is full to the gunnels - which is what Dr McLellan was commenting on - of people who are in for a matter of weeks and sometimes days."
The minister said in these less serious cases, often underlying problems, such as drugs and alcohol, could be identified and treated without locking offenders up.
Tory justice spokeswoman Bill Aitken said the prison population could only be cut by cutting crime.
He said: "If our prisons are overcrowded we should launch a real crackdown on crime, rehabilitate our prisoners in drug and alcohol free jails and have the guts to build more prisons if we need to."