explaingit

modood/administrative-divisions-of-china

20,766JavaScriptAudience · developerComplexity · 1/5MaintainedLicenseSetup · easy

TLDR

Complete dataset of China's administrative divisions (provinces, cities, counties, townships, villages) with official codes, available in JSON, CSV, and SQLite formats.

Mindmap

mindmap
  root((repo))
    What it does
      Five-level divisions
      Official area codes
      Hierarchical data
    Data formats
      JSON files
      CSV files
      SQLite database
    Use cases
      Location pickers
      Regional analysis
      Address validation
    Audience
      Developers
      Data analysts
      China-focused apps

Things people build with this

USE CASE 1

Build location pickers or address autocomplete for Chinese apps and websites.

USE CASE 2

Analyze regional data by matching user locations to official administrative codes.

USE CASE 3

Validate and standardize Chinese addresses in databases or forms.

USE CASE 4

Create hierarchical dropdown menus for province-city-county selection flows.

Tech stack

JavaScriptJSONCSVSQLitenpm

Getting it running

Difficulty · easy Time to first run · 5min
Do what the fuck you want. Public-domain-like.

In plain English

This repository provides a comprehensive dataset of China's administrative divisions across all five official levels: province, city, county, township, and village. The data is sourced from the National Bureau of Statistics of China and follows official statistical area codes and rural-urban division coding standards. The project notes that data will no longer be updated as of October 2024, because the National Bureau of Statistics stopped publicly releasing the specific division codes. Data is available for download in both JSON and CSV formats at each administrative level, with files named provinces.json, cities.json, areas.json, streets.json, and villages.json. Multi-level linked datasets are also provided, allowing developers to work with hierarchical combinations such as province-city two-level data, province-city-area three-level data, and province-city-area-township four-level data, each available with or without official area codes. A SQLite database file is also included, and the data can be migrated to other database systems such as MySQL, Oracle, or MSSQL. The dataset was last updated to reflect 2023 statistical codes with a cutoff date of June 30, 2023. It is available as an npm package called china-division.

Copy-paste prompts

Prompt 1
How do I load the china-division npm package and query cities within a specific province?
Prompt 2
Show me how to parse the provinces.json file and build a cascading dropdown for province-city-area selection.
Prompt 3
I need to import the SQLite database into MySQL, what's the best way to migrate this China divisions data?
Prompt 4
How can I use the multi-level linked datasets to validate that a user-entered county belongs to the correct city and province?
Open on GitHub → Explain another repo

Generated 2026-05-18 · Model: sonnet-4-6 · Verify against the repo before relying on details.