Skip to content

Council codes and areas

A council's code changes when councils merge or a boundary moves. On 1 April 2023, Allerdale, Carlisle and Copeland became Cumberland (E06000063). On 1 April 2025, Sheffield's code went from E08000019 to E08000039, and Barnsley's from E08000016 to E08000038. Every source keeps the codes of the year it was made: the 2021 Census figures use the councils of 2023, while postcode lookups give today's. So figures from different sources line up only once they use the same year's codes.

The uk_open_data.areas module brings any council code to today's, and says which county, community safety partnership and police force area each council is in. It reads small tables that ship with the package, so it needs no network.

from uk_open_data.areas import bring_forward, current_code

current_code("E08000019")   # 'E08000039', Sheffield
current_code("E07000190")   # 'E06000066': Taunton Deane, then Somerset West
                            # and Taunton, now Somerset
bring_forward({"E07000026": 10, "E07000028": 20, "E07000029": 5})
# {'E06000063': 35.0}: Allerdale, Carlisle and Copeland added up as Cumberland

Functions

Function What it does
current_code(code) Today's code for a council code from any year. Spaces around the code and its case do not count. Any other area code, such as a county's, comes back tidied, and anything else, such as a name, as given
bring_forward(counts) Moves counts by council to today's codes, adding up councils that merged. For counts such as people or households, never for rates. A missing count raises an error, so a merged council is never part-counted
todays_codes(codes) Today's code for each code given. An older code is left out when the council it became is also given by today's code, so figures listed under both are not counted twice
retired(code) The change that retired a council code: its old name, the code that took its place and the day. None for a code in use today
local_authorities() Today's councils across the UK: each code and its name
code_changes() Every retired council code, with its name, the code that took its place and the day it did
CODES_YEAR The year of ONS's council codes that today's codes are: 2025. The codes have not changed since
local_authority_lookup(to) The county, community safety partnership or police force area of each council in England and Wales, with the share of residents in each. See below
AREA_KINDS What to can be: "county", "community_safety_partnership" and "police_force_area"

A council whose boundary moved a little, rather than merging, counts whole under its successor of the same name. Most of Barnsley stayed Barnsley in 2025, and a small part went to Sheffield, so figures for the old Barnsley code count as Barnsley.

A council's county, partnership and police force area

Some figures are published for areas larger than a council: recorded crime by community safety partnership, and childhood vaccinations by county. local_authority_lookup(to) says which of those areas each council in England and Wales is in, and how its residents are shared between them, so the figures can be brought to councils.

from uk_open_data.areas import local_authority_lookup

for part in local_authority_lookup("community_safety_partnership"):
    if part.lad_code == "E06000060":  # Buckinghamshire
        print(part.area_name, part.residents, round(part.share_of_lad, 2))
# Aylesbury Vale 204106 0.37
# Chiltern 96681 0.17
# South Bucks 71619 0.13
# Wycombe 180672 0.33
to The areas
"county" The county council, or the council itself where there is one tier, as for a unitary council or a London borough. These are England's 153 upper-tier councils, which DfE and UKHSA publish many figures by, and Wales's 22 councils
"community_safety_partnership" The 314 community safety partnerships, which police-recorded crime is published by
"police_force_area" The 43 police force areas

Each row is a CouncilPart, the part of a council in one area:

Field What it holds
lad_code, lad_name The council, by today's code
area_code, area_name The area
residents How many people lived in this part at the 2021 Census
share_of_lad This part's share of the council's residents. A council's shares add up to 1
share_of_area This part's share of the area's residents. An area's shares add up to 1

Each council lies whole in one county and one police force area, and most lie whole in one partnership. Seven councils are split, because their partnerships still follow the districts they were made from:

  • Buckinghamshire and North Northamptonshire have four partnerships each;
  • Cumberland, and Westmorland and Furness, have three each;
  • West Northamptonshire and East Suffolk have two each;
  • Bournemouth, Christchurch and Poole has Bournemouth's, Poole's, and part of Dorset's, which still covers Christchurch.

To bring a count published for an area to councils, such as crimes in a partnership, multiply it by each part's share_of_area, then add up each council's parts. The need analyses do this for a need published for bigger areas: see Need against reach. This assumes the count is spread like the residents. A rate, such as the share of children vaccinated in a county, applies to each of its councils as it is.

The residents are ONS's published 2021 Census figures for each council, brought to today's codes as above: Barnsley's figure counts whole as Barnsley, though a small part of it moved to Sheffield in 2025. A split council's residents are shared among its partnerships by the residents of its 2021 neighbourhoods, each placed in the partnership whose outline holds its centre. ONS alters each neighbourhood's figure a little so no one can be identified, so neighbourhoods are used only to share out the council's figure, never added up in its place.

Scotland and Northern Ireland are not covered: ONS publishes these lookups for England and Wales.

Where the tables come from

The table of council codes is built from two ONS sources:

  • the Code History Database, June 2026 edition, which records every change to a code;
  • the list of local authority names and codes of April 2025, which gives today's councils.

It holds the 361 councils of the UK and 100 changes to their codes since 2009. Every retired code leads to one of today's councils.

The table of areas is built from ONS's lookups of 2025, from councils to counties and to community safety partnerships and police force areas, with usual residents from the 2021 Census (table TS001, on Nomis). For the split councils it also reads ONS's lookup from 2021 neighbourhoods to councils, the neighbourhoods' centres, and the partnerships' outlines of December 2023. The partnerships have not changed since.

When ONS publishes new council codes, as it will when Surrey's councils are reorganised in April 2027, or new lookups, the weekly check of the public sources fails and says what to do. The steps are at the top of areas/_ingestion.py, the script that rebuilds both tables.

Licensing: Office for National Statistics, Open Government Licence v3.0. list_datasets() lists the tables as ons-code-history and ons-local-authority-lookups.