Some 91% of the country’s population live in settlements and localities which accounted for 2.3% of Scotland’s total land area, the National Records of Scotland (NRS) said.
The largest settlement, defined as densely populated areas up of 500 or more people, was Greater Glasgow with nearly one in five people, or just over one million, living in the area.
Edinburgh followed, with almost 531,000 people, and then Aberdeen, Milltimber and Peterculter, with 220,690.
In Dundee there was 158,820 residents, while in Motherwell and Wishaw there were 125,610.
In Scotland, the number of people living in settlements was more than 4.9 million, while those living outside settlements was just over 491,000.
The NRS’s Population Estimates for Settlements and Localities in Scotland Mid-2020 report, released on Thursday, found there were 514 settlements in the country.
This was five fewer than 2016, due to some merging or falling below the threshold of 500 people, the records office said.
The NRS used information about 140,000 postcodes in Scotland to define settlements and localities.
Settlements are defined as groups of adjacent, densely populated postcode areas that have a combined population of 500 or more people.
Some settlements are divided into localities, the NRS said, to reflect the areas that are more easily identifiable as the towns and cities of Scotland.
Greater Glasgow, for example, is a settlement and contains several localities, for example Giffnock and Clydebank.
Settlements in Scotland tend to be concentrated across the central belt and the east coast, but are sparse in the Highlands and Islands.