gitwtfhub

wtf is administrative-divisions-of-china?

modood/administrative-divisions-of-china — explained in plain English

Analysis updated 2026-05-18

20,742JavaScriptAudience · developerComplexity · 1/5LicenseSetup · easy

TL;DR

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

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Why would anyone build with this?

REASON 1

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

REASON 2

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

REASON 3

Validate and standardize Chinese addresses in databases or forms.

REASON 4

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

What's in the stack?

JavaScriptJSONCSVSQLitenpm

How it stacks up

modood/administrative-divisions-of-chinachokcoco/icsstabler/tabler-icons
Stars20,74220,71220,672
LanguageJavaScriptJavaScriptJavaScript
Setup difficultyeasyeasyeasy
Complexity1/51/51/5
Audiencedeveloperdeveloperdesigner

Figures from each repo's GitHub metadata at analysis time.

How do you spin it up?

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

Wtf does this do

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.

Yoink these 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?

Frequently asked questions

wtf is administrative-divisions-of-china?

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

What language is administrative-divisions-of-china written in?

Mainly JavaScript. The stack also includes JavaScript, JSON, CSV.

What license does administrative-divisions-of-china use?

Do what the fuck you want. Public-domain-like.

How hard is administrative-divisions-of-china to set up?

Setup difficulty is rated easy, with roughly 5min to a first successful run.

Who is administrative-divisions-of-china for?

Mainly developer.

View the repo → Decode another repo

This repo across BitVibe Labs

Don't trust strangers blindly. Verify against the repo.