In Scotland, prostitution itself (the exchange of sexual services for money) is legal, but associated activities (such as public solicitation, operating a brothel, or other forms of pimping) are criminal offences.
In 1982, the Civic Government (Scotland) Act 1982 came into force. This prohibited soliciting, but also gave local councils the power to license places of entertainment. Edinburgh Council issued licenses to Massage parlours and saunas, effectively allowing brothels.
In 2013, the Scottish police forces were merged to form Police Scotland. Previously each local force had had its own policy regarding prostitution. Police Scotland applied one policy to all of Scotland. This resulted in raids on the saunas in June 2013. Many of the saunas were forced to close.
In 1985, Lothian and Borders Police negotiated with Edinburgh's prostitutes to form a tolerance zone in Leith's Coburg Street area. In return for the police 'turning a blind eye', the prostitutes would stay within this area. Gentrification was happening in the Coburg Street area and in August 2001 the toleration zone was moved to an industrial estate in Salamander Street. Following protests from local residents the toleration zone was closed in November 2001.
Aberdeen set up a tolerance zone in the dock area in 2001. The Prostitution (Public Places) (Scotland) Act 2007 came into force in October 2007. This act criminalised kerb crawling and as result the tolerance zone was closed.
Scottish National Party MSP Margo MacDonald introduced the Prostitution Tolerance Zones Bill to the Scottish Parliament in 2002. This would have allowed tolerance zones to be set up. Following an enquiry by an expert group into prostitution, the Bill was withdrawn in November 2005.
In April 2019, some sex work charities called for lawmakers in Scotland to reject a sex work policy, after statistics showed that violent crime against sex workers almost doubled after it was introduced in Ireland. The increase in Ireland was associated with the introduction of the "Nordic Model", a Swedish law which criminalises people who buy sex, rather than those who sell it. The stats originated from UglyMugs, an app where sex workers can report incidents of abuse and crime, and receive alerts about dangerous clients.
Kerb crawling, soliciting a prostitute for sex in a public place, and loitering for the same purpose are also criminal offences, with a maximum penalty of a £1000 fine, under the Prostitution (Public Places) (Scotland) Act 2007 (in force 15 October 2007), as follows:
11 Trading in prostitution and brothel-keeping.
shall be guilty of an offence.
Section 13 makes provision about male prostitution. Third-party activities, such as pimping, procuring, and living off the avails, are illegal under section 7 (Procuring) and section 11 of the Act. .
An expert group was assembled in 2003, and produced a report in 2004 entitled Being Outside - Constructing a Response to Street Prostitution. The key proposals included replacing soliciting laws with "offensive behaviour or conduct", applicable to both buyer or seller (obviating pressure to criminalise kerb crawling), and "managed areas" in which the activity would take place. They also recommended a national framework to guide local authorities, a requirement for local implementation plans, and public education. 
A Prostitution Tolerance Zones Bill was introduced into the Scottish Parliament, but failed to become law. Instead, the Parliament passed the Prostitution (Public Places) (Scotland) Act 2007, which leaves the law relating to prostitutes unchanged, but introduces a new offence committed by their clients.
In April 2010, a plan to criminalize the customers, which had been introduced by Labour politicians, was rejected. A further attempt by Marlyn Glen (Labour) to introduce this (amendment 6) at Stage 3 was also voted down 78: 44 on 30 June 2010. 
A further attempt by Trish Godman (Labour) was made in 2011, but fell at dissolution. Yet another attempt was made by Rhoda Grant (Labour) was made in 2013, but was only supported by Labour MSPs, and therefore, did not receive cross-party support.
In September 2015, independent MSP Jean Urquhart lodged a proposal with the Scottish Parliament for a Prostitution Law Reform Bill that would decriminalise sex work in Scotland, in line with the New Zealand model. Jean Urquhart worked closely with SCOT-PEP, a Scottish charity that advocates for the safety, rights, and health of everyone who sells sex in Scotland, in developing the proposals. The proposals included the repeal of soliciting and kerb-crawling laws, changes to brothel-keeping laws to allow up to four sex workers to work collectively from the same indoor premises, and a proposal for larger commercial brothels. The proposed Bill also sought to repeal laws on living on the earnings of sex work, which criminalise family members, friends, and flatmates of sex workers. The consultation period ran for a period of 3 months, and results showed that 70% of the respondents were in favour of the aims of the proposed Bill. An event was held in the Scottish Parliament on Tuesday, 10 November 2015, to present the proposals contained in the Bill with speakers from SCOT-PEP, the New Zealand Prostitutes Collective, the English Collective of Prostitutes, the National Ugly Mugs, the National Union of Students, as well as academics experienced in researching sex work.
In March 2017, the Scottish National Party backed changes to prostitution laws to criminalise those paying for sex, but not those who sell it. The decision drew criticism from sex workers and sex worker organisations, who said that full decriminalisation was the only way to the ensure the safety of sex workers.
The Scottish Green Party support the decriminalisation of sex work along with full legal protection from exploitation, trafficking and violence, and access to better support and healthcare for sex workers.
Published anonymously in 1775, Ranger’s Impartial List of Ladies of Pleasure was a review of 66 of Edinburgh's prostitutes. The author was later revealed to be James Tytler, editor of the Encyclopædia Britannica.
A typical entry
Miss Sutherland, Back of Bell’s Wynd
This Lady is an old veteran in the service, about 30 years of age, middle sized, black hair and complexion and very good teeth, but not altogether good-natured.
She is a firm votary to the wanton Goddess, and would willingly play morning, noon, and night.
As a friend, we will give a caution to this Lady, as she has a habit to make free with a gentleman’s pocket, especially when he is in liquor.
A survey in 1842 found that when the General Assembly met in Edinburgh that the brothels were particularly busy. In 2004 a committee of the Scottish Parliament were debating zones of tolerance for prostitution and Margo MacDonald referred to Blythswood Square in Glasgow as having been in the past a haunt of prostitutes.