Saughton Prison is Scotland’s most crime-ridden jail with more than 1,000 offences committed there in just three years.
Glasgow’s Barlinnie prison had the second highest crime rate with 367 offences since the start of 2013.
The crimes taking place behind bars range from drug smuggling and dealing and assaults to robbery and knife carrying.
A total of 3,646 prison-based crimes have been reported to police over the last three years with nearly 750 of them going unsolved.
HMP Perth had 319 crimes over the three-year period while privately-run Addiewell in West Lothian had 309.
There were 311 crimes at Kilmarnock Prison, 257 at Shotts and 184 at Cornton Vale, Scotland’s only women’s prison.
HMP Inverness had the lowest crime rate with just 38 cases reported to police in the last three years.
The offences, which were revealed under freedom of information laws, include crimes committed by prisoners, visitors and prison staff.
At Saughton, the crimes committed included a knife attack on serial killer Peter Tobin in his cell.
The murderer was slashed across the face and throat with a home-made razor by double rapist Sean Moynihan in July.
In October, Moynihan, 31, was jailed for 32 months for the attack.
Earlier this year, it was revealed a killer ran a £1 million heroin ring from his cell in the jail.
Stephen Nisbet, 40, used a secret stash of mobile phones inside to arrange drug deals across Scotland.
His businessman brother James, 46, set up a recycling firm as a front to help flood the country with heroin.
Nisbet had an extra 12 years added to his 18-year sentence after being convicted of running the operation.
Paul Bulman operated a Europe-wide drug ring from the prison using hidden mobile phones to direct operations.
He arranged for 70kg of the Class B drug pentedrone - worth Pounds 500,000 - to be shipped to Aberdeen from the Netherlands.
Of the 1,008 crimes reported to police at the prison, 347 remain unsolved.
The Scottish Prison Service said they had launched the Prison Watch Scotland scheme which “encourages members of the public to report suspicious activity around prison estates” at Edinburgh in 2011 and it has been rolled to a number of other establishments across the country.
Police Scotland said they could not comment on the unsolved cases.