Municipality Hrpelje - Kozina, which is part of the Obalno-kraška statistical region, measures 195 km2; this ranks it 27th among Slovene municipalities.
Statistical data for 2021 reveal the following:
In the middle of 2021 about 4,870 people (about 2,550 men and 2,330 women) were living in the municipality, which ranks Hrpelje - Kozina 106th among Slovene municipalities. The population density was 25 people per square kilometre, which was lower than the national average of 104 people per square kilometre.
The number of live births was higher than the number of deaths, which means that natural increase per 1,000 population in the municipality was positive. It was 2.7 (in Slovenia -2.0). The number of people who moved from the municipality was lower than the number of people who moved into the municipality, so net migration per 1,000 population in the municipality was positive. It was 23.8. The sum of natural increase and net migration per 1,000 population in the municipality was positive. It was 26.5 (in Slovenia -0.9).
The mean age of people in Hrpelje - Kozina was 44.3 years, which was lower than the national average (43.8).
As in most Slovene municipalities, in Hrpelje - Kozina the number of old people was higher than the number of young people: there were 143 people, aged 65 or more, per 100 people aged 0–14. This ratio shows that the value of the ageing index was higher than the national average of 139. It also shows that the mean age of people in Hrpelje - Kozina is growing more rapidly than in Slovenia as a whole. Data by sex show that the ageing index for women was in all municipalities except in five (Črna na Koroškem, Dobrovnik/Dobronak, Jezersko, Loški Potok in Mislinja) higher than the ageing index for men. In Hrpelje - Kozina – as in most Slovene municipalities – more women were 65+ years old than 14 or less; for men the situation was the same.
Hrpelje - Kozina had 2 kindergartens, which were attended by 188 children. Of all children in the municipality aged 1–5, 82% were included in kindergartens, which was more than the national average of 81%. In the school year 2021/22 elementary school in Hrpelje - Kozina was attended by about 390 pupils, while various upper secondary schools were attended by about 150 pupils. There were 29 students and 5 graduates per 1,000 people in the municipality; in Slovenia the averages were 39 per 1,000 and 8 per 1,000, respectively.
Among people aged 15–64 (i.e. working age population) about 68% were persons in employment (i.e. persons in paid employment or self-employed persons), which is more than the national average (67%).
In Hrpelje - Kozina, average monthly gross earnings per person employed by legal persons were about 18% lower than the annual average of monthly earnings for Slovenia; net earnings were about 16% lower.
Among 1,000 inhabitants in the municipality, 623 had a passenger car. The car was on average 11 years old.
In 2021, 319 kg of municipal waste per person was collected in Hrpelje - Kozina, which is 46 kg less than on average in Slovenia.