China Administrative BoundariesGB/T 2260 · WGS 84 Browse datasets

Three levels, one six-digit code.

China's administrative divisions come in three layers, and each layer answers a different question. Knowing which layer a boundary belongs to, and what the six digits of its code mean, is what turns a boundary file into something that joins. This page covers the levels, the numbering, and the places where the pattern breaks.

The three levels, and what sits at each

Province level has 34 units: 23 provinces, 5 autonomous regions, 4 municipalities and 2 special administrative regions. Prefecture level has 368: prefecture-level cities, prefectures, leagues, autonomous prefectures, and the county-level cities that a few provinces administer directly. County level has 2,890: districts, counties, banners, autonomous counties and county-level cities. The province layer, city layer and county layer are sold separately, and each also comes as a single-province file.

All three layers are cut from one geometry set, so a province polygon and the county polygons inside it share edges exactly. A provincial file drops into a national build without a schema change, because the fields are the same at every level: a six-digit code, name_en and name_zh.

How a GB/T 2260 code is built

Six digits, read in pairs. The first two digits are the province, the middle two the prefecture, the last two the county. Beijing is 110000: province 11, then zeros where the lower levels would be. Hangzhou is 330100: province 33 for Zhejiang, prefecture 01, then 00 because Hangzhou is not itself a county. Shangcheng District, inside Hangzhou, is 330102.

The zeros are the part people misread. A province code ends in 0000, a prefecture code ends in 00, a county code ends in anything else. So 330000, 330100 and 330102 can sit in the same column of a table and still describe three different things. Read the trailing zeros before treating two codes as duplicates.

Because the code is hierarchical, a prefix is a query. Everything starting with 33 is Zhejiang; everything starting with 3301 is Hangzhou. Summing on the first four digits gives a prefecture total without a lookup table.

Why the city layer holds 368 units

This layer is not a list of prefecture-level cities. Thirty-two of its 368 units are county-level units that a province administers directly, so their codes end in two digits that are not zeros: Jiyuan in Henan (419001), four in Hubei (429004, 429005, 429006 and 429021), fifteen in Hainan (469001 through 469030) and twelve in Xinjiang (659001 through 659012). Each of them is a second-level unit in the administrative sense and a county-level unit in the code.

They also appear in the county file, and there they carry their own code as the parent. That is the most common source of double counting: sum a column of county areas and a column of prefecture areas and those 32 units are added twice. When a total has to reconcile, decide which layer owns them and exclude them from the other. The trailing digits are how to find them without a list.

Two more patterns matter. The four municipalities have no prefecture layer at all: their 85 districts hang directly under the city, which is why 85 county-level units carry no prefecture code. Hong Kong, Macao and Taiwan add another 39 county-level units with no prefecture parent. In total 124 of the 2,890 county units have no city code, and that emptiness is deliberate rather than missing data.

Where the naming pattern breaks

Not every second-level unit is a city. Inner Mongolia has leagues and its counties include banners and autonomous banners; Xinjiang and Tibet have autonomous prefectures. A filter written as a name match on the word City silently drops them. Filter on the code or on the four-digit prefix instead, and the type stops mattering.

The four municipalities are the other trap. Beijing, Tianjin, Shanghai and Chongqing have districts at county level and nothing in between, so a province-to-city-to-county drill-down has to skip a step for them. Hong Kong and Macao have one level only, and are sold at county level here, since neither has a second level to sell.

Joining boundaries to a statistical table

Match on the six-digit code, never on the name. Names change: a county becomes a district, a district is split, a prefecture is renamed, and a table keeps using the old wording for years. The code usually survives that, and where it does not, the change shows up as a missing code rather than a quiet mismatch.

Expect gaps when the table is older than the boundary file. Compare the two code sets in both directions before joining: which codes in the table have no polygon, and which polygons have no row. Then put the unmatched names side by side. A missing code with a matching name is usually a rename; a missing code with no name match is usually a division that was merged or newly created.

Choosing a level for the job

A national choropleth that colors provinces needs the province layer, at $19.99. A comparison across cities needs the city layer, $59.99 nationally or $19.99 for one province. Anything keyed to county statistics needs the county layer, $99.99 nationally or $39.99 per province. When the output is a slide, a poster or a CAD drawing, the DXF in the zip is projected to meters and simplified, which is usually the file that behaves in Illustrator.

The Zhejiang city sample uses the same schema as the paid files and arrives at no cost, so the field names and the code format can be checked before buying anything. The formats page lists what each of the seven files contains.

Questions

Is the six-digit code the same as a postal code?

No. Postal codes are assigned for mail delivery and are not nested the way administrative codes are. A GB/T 2260 code identifies an administrative unit together with its province and prefecture, which is why it joins to statistical tables and a postal code does not.

Why do 124 county-level units have no city code?

Eighty-five are districts of the four municipalities, which have no prefecture layer. Thirty-nine are in Hong Kong, Macao and Taiwan, which have no second level. The field is empty because there is no parent unit, not because a value went missing.

Can an older statistical table be joined to the current boundaries?

Usually, with gaps. Compare the two code sets first, then match the leftovers by name. A rename keeps the code and loses the name; a merger or a new district loses the code as well. Both cases are visible before the join runs, not after.

Does the data include Taiwan, Hong Kong and Macao?

Yes. Taiwan is one of the 34 province-level units. Hong Kong and Macao are special administrative regions, sold at county level with 18 and 1 units, because neither has a second level to sell.

Which level should be bought for a national map?

Provinces if the map is read at country scale, cities if readers need to compare places, counties if the figures are keyed to districts. The county layer matches most published statistical tables, and it is the one whose size people underestimate.

Check it against your own software

The sample is a full province in every format, free and without a signup.