Photo: Richard Webb · CC BY-SA 2.0A larger share of residents with no religion than 99% of UK towns: 59%
Here 31% of households have dependent children, where the figure across Scotland’s towns is 24%. Across Bonnyrigg, 30% of households live in a terraced house. At 16%, the share of households in flats is higher than in nearly three quarters of UK towns. There were 7,406 households here at the 2022 Census, home to 18,088 residents.
Younger than 66% of UK towns: half of Bonnyrigg is under 42.4
Share of residents in each five-year age band, Census 2022.
50–54 is the most common age band: 7.3% of residents. At 19%, the share of residents aged 65 and over is lower than in 71% of UK towns. Where 12% of residents are aged 15 to 24 across Scotland’s towns, Bonnyrigg has 11%.
Median age of UK towns of 2,500+
■ Bonnyrigg, 42.4. The typical town is 44.4.
Broad ages · share of residents
Women and men · all residents
52% women, 48% men
About 93 men for every 100 women. Across Scotland, 51% of residents are women.
Full-time students make up 5% in Bonnyrigg, more than in 60% of UK towns
What adults did at the 2022 Census (the NS-SEC classes).
Adults by occupation class · residents 16 and over
Managerial and professional jobs take in 36% of adults here, routine and semi-routine work 23% (Scotland’s towns: 33% and 25%). Typically, nearly one in ten adults are full-time students across Scotland’s towns.
The Census was taken on 20 March 2022, in term time, so students were counted at their term addresses.
Larger households than 82% of UK towns: 2.4 people on average
Household make-up at the 2022 Census. Each square is 1% of households.
Against Midlothian’s towns and Scotland’s towns
People per household
Scotland’s towns.
One-person households: 26%, below 78% of UK towns. Shared households of unrelated adults account for 2.3%.
A smaller share of households in detached houses than 62% of UK towns: 25%
Accommodation type and cars or vans per household, Census 2022. Owning and renting are on Cost of living.
Type of home
Cars or vans · share of households
18% of households have no car or van; across Scotland’s towns the figure is 29%.
A smaller share of residents whose main language is English than 62% of UK towns: 97%
Country of birth, year of arrival and main language, Census 2022.
Born outside the UK, by region · share of all residents; the bar runs to 15%
When those born abroad arrived
Main language · residents aged 3 and over
Of residents born abroad, 14% arrived in 2017 or later, against 34% across Scotland’s towns. Residents whose main language is English make up 94% across Scotland’s towns. By birthplace, the largest groups from abroad were born in EU countries (2.9%) and in the Middle East and Asia (2%). At 6.7%, the share of residents born outside the UK is higher than in 53% of UK towns.
Fewer residents who describe themselves as Christian than 98% of UK towns: 34%
How residents described themselves at the 2022 Census. Lines join the lowest and highest of the three figures.
Ethnic groups other than White British · all residents
White British, not charted: 91% of Bonnyrigg · Midlothian’s towns 90% · Scotland’s towns 86%.
Religion · all residents
After White British, the most common groups are Other White (3.8%), Pakistani (1.4%) and Mixed or multiple (0.9%). Set beside that, 39% of residents describe themselves as Christian across Scotland’s towns. Just over nine in ten residents describe themselves as White British, a lower share than in 58% of UK towns.
Married adults and civil partners make up 52% in Bonnyrigg, more than in 74% of UK towns
Legal partnership status (residents 16 and over) and unpaid care (residents 3 and over), Census 2022.
Partnership status · residents 16 and over
Unpaid care given · share of residents 3 and over
Nearly a third of adults have never married or formed a civil partnership, against 40% across Scotland’s towns. Set beside that, just over two in five adults are married or in a civil partnership across Scotland’s towns. Unpaid carers account for 13%.
Degree-level qualifications reach 29% of adults
Highest qualification, residents 16 and over, Census 2022.
Highest qualification · residents 16 and over
Against 32% across Scotland’s towns, 29% of adults here have a degree-level qualification, while 15% hold no qualification (17%).
101st youngest of 309 UK towns of 13,000 to 24,000 people
Median age, Census 2022. Hover a dot for its students and residents born abroad; click for its page.
At the ends of the range sit Aberystwyth (25), the youngest, and Sidmouth (60.4), the oldest. Nearest to Bonnyrigg in age: Bourne (42.4), Brownhills (42.4), Horwich (42.5) and Enderby and Narborough (42.5).
Of the 7 towns nearest Bonnyrigg, 2 are older
Nearby towns coloured by median age, Census 2022. Tap a town for its page.
| Town | People | Away | Median age | 65+ | Homes with children |
|---|---|---|---|---|---|
| Bonnyrigg | 18,088 | — | 42.4 | 19% | 31% |
| Loanhead | 7,007 | 1.9 mi | 46 | 23% | 24% |
| Mayfield | 14,259 | 2.2 mi | 40.4 | 17% | 29% |
| Dalkeith | 15,125 | 2.3 mi | 41.2 | 19% | 28% |
| Danderhall | 3,389 | 2.9 mi | 39.6 | 18% | 29% |
| Gorebridge | 8,900 | 3 mi | 36.1 | 13% | 35% |
| Penicuik | 16,431 | 5 mi | 43.8 | 23% | 25% |
| Musselburgh | 21,476 | 5.2 mi | 41.6 | 19% | 23% |
Health, work and homes have their own pages
What this data can and can’t tell you
- The Census was taken in term time. 20 March 2022 fell in term time, and students were asked to give their term-time address, so most were counted where they study. Some may have been living with family that day.
- “Midlothian’s towns” and “Scotland’s towns” mean their towns. Census comparisons pool every locality in Midlothian (or Scotland), summed the same way as Bonnyrigg’s figures, so households in open countryside are left out.
- Small counts are blurred. National Records of Scotland adjusts small Census counts to protect privacy, so the same total differs a little between tables, and the shares of a small town can move by a point or two.
Questions about Bonnyrigg’s residents
What is the population of Bonnyrigg?
The 2022 Census counted 18,088 people in Bonnyrigg’s locality.
What is the average age in Bonnyrigg?
The median age was 42.4 at the 2022 Census, younger than 66% of UK towns. 11% of residents were 15 to 24 and 19% were 65 or over.
How diverse is Bonnyrigg?
91% of residents described themselves as White British in 2022, against 86% across Scotland’s towns and 90% across Midlothian’s towns. 6.7% were born outside the UK.
What religion are people in Bonnyrigg?
59% said they had no religion and 34% that they were Christian at the 2022 Census; 1.9% were Muslim and 5% didn’t answer.
Is Bonnyrigg good for families?
31% of households had dependent children in 2022, against 24% across Scotland’s towns. Schools are on Bonnyrigg’s schools page.
Sources: Scotland’s Census 2022 (National Records of Scotland), output areas summed to the NRS 2022 locality (UV101b, UV103, UV104, UV113, UV201, UV204b, UV205, UV212, UV301, UV402, UV405, UV406, UV501, UV607, UV801). Open Government Licence v3.0.
Contains public sector information licensed under the Open Government Licence v3.0. Contains HM Land Registry data © Crown copyright and database right 2026. Contains OS data © Crown copyright and database right 2026 (ONS boundaries). Northern Ireland: Source: NISRA; contains Land & Property Services data and Ordnance Survey of Northern Ireland information, © Crown copyright, licensed under the Open Government Licence v3.0. Scotland: contains National Records of Scotland data, Registers of Scotland data and SEPA data, © Crown copyright / © SEPA 2025, licensed under the Open Government Licence v3.0.