The National Records of Scotland hold records of the census of the population of Scotland for 1841 and every tenth year thereafter (with the exception of the wartime year of 1941 when no census was taken) and of the sample census of 1966. Census records are closed for 100 years under the Freedom of Information (Scotland) Act 2002.
There has been a census every ten years since 1801 (excluding 1941) but only those returns after 1841 (with a few earlier exceptions) carry details of named residents. Census returns for 1841-1911 can be consulted at the National Records of Scotland in Edinburgh and online at ScotlandsPeople (see also the GRO tutorial). Copies of the LDS indexes to the 1881 census returns are also held.
Copies of the census returns for 1841-1891 may be consulted on microfilm in LDS Family History Centres around the world. LDS centres also carry indexes to the 1881 census returns. A useful listing of Microfilm Numbers of Scottish Census Records has been provided by David Wills.
Commercial services such as Ancestry and Findmypast now have transcriptions/indexes (but no images) of the 1841, 1851, 1861, 1871 and 1891 Scottish census returns. Access to these paid-for services is often available free of charge from public libraries and other selected locations, whilst free trials and short-term special deals are occasionally on offer.
FreeCen Scotland is a project indexing 19th Century census records and putting them online with free access, starting mainly with 1841 and some 1851 records. It is part of UK Census Online. Indexes for the UK or any individual place or county can be searched from the FreeCen Search page.
Scotland census finder is a tool designed to help you find sites which offer free census records online for Scotland. It has extensive lists of census indexes, organised by county. It is part of the censusfinder site of Brenda Hay.
The 3rd edition of Census Records for Scottish families at Home and Abroad by Gordon Johnson has been published by Aberdeen & N.E.Scotland FHS, ISBN 0 947659 74 9, vi, 100pp. The book, which can be purchased from the society directly, includes an outline of census records in many other countries and a directory of census holdings in Scottish libraries and archives, updated to include changes resulting from the 1996 local government reorganisation.
Peter Ruthven-Murray's information leaflet Scottish Census Indexes, 1841-1871 is published by and available from the Scottish Association of Family History Societies.
SCROL - Scottish Census Results On Line gives access to statistical information from the 2001 census.