Administrative-divisions-of-China README

The project's README from github.com/modood/Administrative-divisions-of-China. As one markdown file: README.md.

Administrative-divisions-of-China

code style npm downloads license

中华人民共和国行政区划(五级):省级、地级、县级、乡级和村级。

数据来源

【温馨提醒:本项目数据不再更新】

根据国务院批复同意的《关于统计上划分城乡的规定》(国函〔2008〕60号)及国家统计局印发的《统计用区划代码和城乡划分代码编制规则》(国统字〔2009〕91号),统计用区划代码和城乡划分代码是开展各项普查、全面统计、抽样调查、专项调查等政府统计工作的基础,属于工作中使用的内部资料,不适用于向全社会公开。根据国家统计局政府信息公开相关要求,自2024年10月起,国家统计局继续公开《关于统计上划分城乡的规定》《统计用区划代码和城乡划分代码编制规则》等统计标准方法,不再公开具体相关代码。

数据下载

文件列表 JSON CSV
省级(省份、直辖市、自治区) provinces.json provinces.csv
地级(城市) cities.json cities.csv
县级(区县) areas.json areas.csv
乡级(乡镇、街道) streets.json streets.csv
村级(村委会、居委会) villages.json villages.csv
文件列表 普通 带编码
“省份、城市” 二级联动数据 pc.json pc-code.json
“省份、城市、区县” 三级联动数据 pca.json pca-code.json
“省份、城市、区县、乡镇” 四级联动数据 pcas.json pcas-code.json
“省份、城市、区县、乡镇、村庄” 五级联动数据 - -

提示:需要打包下载全部文件,请看 Releases。

数据库支持

目前本项目数据保存在 sqlite3,数据文件下载:data.sqlite。

可以自己将数据迁移到其他数据库管理系统中(MySQL, Oracle, MSSQL 等)。

省级数据预览

code name
13 河北省
14 山西省
15 内蒙古自治区
45 广西壮族自治区

地级数据预览

code name provinceCode
1301 石家庄市 13
1401 太原市 14
1525 锡林郭勒盟 15
4503 桂林市 45

县级数据预览

code name cityCode provinceCode
130111 栾城区 1301 13
140121 清徐县 1401 14
152527 太仆寺旗 1525 15
450305 七星区 4503 45

乡级数据预览

code name areaCode cityCode provinceCode
130111200 南高乡 130111 1301 13
140121102 东于镇 140121 1401 14
152527201 贡宝拉格苏木 152527 1525 15
450305004 漓东街道办事处 450305 4503 45

村级数据预览

code name streetCode areaCode cityCode provinceCode
130111200201 南高村委会 130111200 130111 1301 13
140121102001 东于社区居委会 140121102 140121 1401 14
152527201206 敦达乌苏嘎查 152527201 152527 1525 15
450305004006 横塘社区 450305004 450305 4503 45

Administrative-divisions-of-China (modood/Administrative-divisions-of-China)

Searching Database…

What is this?China's administrative divisions at five levels — provinces, cities, counties, towns and villages — each with its official statistics code and name, provided as JSON, CSV and SQLite files.
Is it a library I install, or just data files?Just data, not a library: one flat JSON and CSV file per level, plus pre-linked cascade files and a data.sqlite database — nothing to install and no dependencies.
How do I get the data?Download the JSON or CSV files for the levels you need straight from the repo, or grab the full bundle from Releases; all the data also comes as a ready data.sqlite file.
Do I need Node.js or any other runtime to use it?No — plain JSON, CSV and SQLite files can be read from any language or tool; Node.js is only needed to run the repo's own fetch and build scripts.
Is the data still being updated?No — the data is frozen at the 2023 edition (cutoff June 30, 2023) because the National Bureau of Statistics stopped publishing the division codes in October 2024, so anything newer is missing.
Where does the data come from?From China's National Bureau of Statistics — its statistical division codes and urban-rural classification codes, the same codes government statistics work is based on; the repo mirrors their 2023 edition.
How are the five levels linked together?Each record carries a 12-digit code plus its parents' codes (provinceCode, cityCode, areaCode, streetCode), and cascade files bundle two to four levels (pc, pca, pcas) in a plain and a code-annotated version; there is no ready-made five-level cascade.
Are these codes the same as postal codes?No — they are statistical division codes from the National Bureau of Statistics, not postal codes. The codes are hierarchical: each level extends its parent's code, which is what makes the cascade files nest cleanly.
What do people typically build with this dataset?Mostly cascading address pickers — pick a province, then city, district, town and village — for web or mobile forms, plus data work that needs official division codes, like cleaning addresses or aggregating statistics by region.
Creator
modood
Size
163.2 MB
Stars
21K
Age
10y
Commits · 90 Days