Fewer people have a faith, with those who say they have no religion outnumbering the biggest denomination, the Church of Scotland, for the first time. More than 1.9 million people said they did not follow a religion in 2011, 532,000 more than in 2001.
The statistics show immigration rose while a new question on national identity revealed that almost two-thirds of people in Scotland now identify themselves as "Scottish only", with one in five of the population describing themselves as both Scottish and British.
Those statistics, along with other data on home and car ownership and ethnicity, will help shape future public policy.
Registrar General for Scotland and chief executive of National Records of Scotland Tim Ellis said: "These latest results paint a detailed picture of Scottish society and it's a more multicultural picture than we have seen before. There is more ethnic and religious diversity."