Deprivation (IMD)
The uk_open_data.imd module loads UK deprivation data, keyed on ONS geography
codes so it joins to boundaries and statistics.
A single nation returns that nation's official index. "UK" returns a
composite — the only way to compare deprivation across nations.
Official per nation, composite for comparison
Each UK nation publishes its own index, on its own geography, ranked only within its own borders — an English "decile 1" and a Scottish "decile 1" are not the same thing:
| Nation | Official index | Geography | Areas |
|---|---|---|---|
| England | IoD 2025 (or 2019) | LSOA 2021 (2019: LSOA 2011) | 33,755 / 32,844 |
| Wales | WIMD 2025 (or 2019) | LSOA 2021 (2019: LSOA 2011) | 1,917 / 1,909 |
| Scotland | SIMD 2020 | Data Zone 2011 | 6,976 |
| Northern Ireland | NIMDM 2017 | SOA | 890 |
To compare across nations you need one shared ranking. There is no official
UK-wide index, so KindTech uses the
mySociety composite UK IMD
(nation="UK"), which re-ranks every area onto one scale. The composite is a
third-party harmonisation, not a National Statistic — use it for
comparison, and a nation's official index for within-nation work.
load_imd()
from uk_open_data import load_imd
england = load_imd(nation="England") # official IoD 2025, 2021 LSOAs
england_19 = load_imd(nation="England", year=2019) # official IoD 2019, 2011 LSOAs
wales = load_imd(nation="Wales") # official WIMD 2025, 2021 LSOAs
wales_19 = load_imd(nation="Wales", year=2019) # official WIMD 2019, 2011 LSOAs
uk = load_imd() # composite, cross-nation comparison
nation accepts "UK" (default), "England", "Wales", "Scotland",
"Northern Ireland", or the codes E/W/S/N.
nation="England" — official English Indices of Deprivation
The richest path: gov.uk File 7 (all ranks, scores, deciles and population
denominators). year=2025 (default, 2021 LSOAs) or year=2019 (2011
LSOAs) — same schema, so 2019 → 2025 is a clean change comparison.
Returns geography_code, geography_name, nation, lad_code, lad_name,
the overall imd_score/imd_rank/imd_decile, a score + rank + decile
for each of the seven domains (income, employment, education,
health, crime, housing = barriers to housing & services,
living_environment; e.g. income_rank, income_decile), and a population
denominator. Ranks/deciles are within-England (rank 1 / decile 1 = most
deprived).
nation="Wales" — official Welsh Index of Multiple Deprivation 2025
year=2025 is the default. It reads WIMD 2025 from the StatsWales API, each
neighbourhood's local authority from the same dataset's list of areas, and its
mid-2022 residents from Nomis, the year England's index uses. So it returns the
columns an analysis reads from England's index: geography_code (2021
LSOA), geography_name, nation, lad_code, lad_name, imd_rank,
imd_decile and population, plus a rank and decile for each of WIMD's eight
domains (income, employment, health, education, access, housing,
community_safety, physical_environment). WIMD publishes no scores.
Before this version load_imd(nation="Wales") gave WIMD 2019 on 2011
LSOAs. Pass year=2019 for it, as below.
nation="Wales", year=2019 / "Scotland" / "Northern Ireland" — official, within-nation
Each nation's own official index, fetched from its government source (WIMD 2019,
SIMD 2020, NIMDM 2017). These publish ranks (1 = most deprived), so the
output is geography_code (LSOA / Data Zone / SOA), geography_name, nation,
the overall imd_rank, a within-nation imd_decile derived from that rank, and
a <domain>_rank for each of that nation's domains. The domain sets differ
by nation (only income/employment/health/education/access are shared):
| Nation | Source | Domains (<domain>_rank) |
Extra |
|---|---|---|---|
| Wales (WIMD 2019) | gov.wales (ODS) | income, employment, health, education, access, housing, community_safety, physical_environment | — |
| Scotland (SIMD 2020) | gov.scot (XLSX) | income, employment, health, education, access, crime, housing | population |
| N. Ireland (NIMDM 2017) | Open Data NI (CSV) | income, employment, health, education, access, living_environment, crime_disorder | — |
2025 availability
England and Wales have a 2025 index. Scotland and Northern Ireland have no
2025 release, so year=2025 raises for them.
Reading XLSX/ODS sources
Wales (ODS) and Scotland (XLSX) are spreadsheets, read via
python-calamine (a KindTech
dependency). No extra setup needed.
nation="UK" — composite (cross-nation comparison)
Returns geography_code (LSOA 2011 / Data Zone / SOA), nation, and:
| Column | Description |
|---|---|
imd_rank |
UK-wide rank (1 = most deprived) |
imd_decile |
UK-wide, population-weighted decile |
imd_quintile |
UK-wide, population-weighted quintile |
nation_decile |
The official within-nation decile (not UK-comparable) |
imd_score, income_score, employment_score, local_score |
Underlying scores |
Use this only when comparing areas in different nations; its imd_rank /
imd_decile are the UK re-ranking, not a nation's official figures (those are
in nation_decile, or use the single-nation calls above).
Keeping an index on this machine
load_imd(nation="England") downloads the published file from gov.uk the
first time a program asks for it, and load_imd(nation="Wales") asks
StatsWales and Nomis. To run with no download, keep a copy in the
data folder, the same one that holds the
postcode table:
from uk_open_data.imd import download_imd, imd_path, keep_imd, load_imd
download_imd() # fetch the 2025 index once, when a server is built
imd_path() # where the copy is, or None
load_imd(nation="England") # reads the copy; nothing is downloaded
keep_imd(table, note) keeps a table of your own in its place, for a
demonstration or a test. Give a DataFrame or a list of row dictionaries with
at least geography_code, geography_name, lad_code, lad_name,
imd_decile and population. Columns you leave out come back empty. The
note says where the figures came from, and kept_imd_note() reads it back.
Pass year=2019 to any of these for the 2019 English index. Pass
nation="Wales" for the Welsh 2025 index, such as
download_imd(2025, "Wales"). Only these can be kept: the English index of
2019 or 2025, and the Welsh index of 2025. A url given to load_imd is
always downloaded.
Joining to boundaries and statistics
geography_code matches the rest of KindTech, so deprivation overlays onto a map
or merges with population for per-capita work:
import pandas as pd
from uk_open_data import load_imd, load_geodata, geodata_to_properties
imd = load_imd(nation="England") # IoD 2025, on 2021 LSOAs
# Default boundaries are 2021 LSOAs — a native join, no crosswalk
geo = pd.DataFrame(geodata_to_properties(load_geodata("LSOA"), "LSOA", 2021))
mapped = geo.merge(imd, on="geography_code", how="left")
LSOA vintage
England IoD 2025 and WIMD 2025 are on 2021 LSOAs, so they join natively to Census 2021 and the default boundaries — no crosswalk needed.
Everything else — England IoD 2019, WIMD 2019, the composite
(nation="UK"), Scotland and Northern Ireland — is on 2011 or older
geographies. To join those, either
use 2011 boundaries (load_geodata("LSOA", year="2011")) or map postcodes
via lsoa11 (see Postcodes).
Licensing
The composite dataset is licensed CC-BY 4.0 by mySociety; the underlying national indices are Open Government Licence v3.0. See Data Sources for details and attribution.