---
id: "th_province_code"
kind: "datatype"
status: "draft"
is_pii: false
name: "Thai province code"
regexp: "^(?:1[0-9]|2[0-7]|[34][0-9]|5[0-8]|6[0-7]|7[0-7]|8[0-6]|9[0-6])$"
categories: ["geo", "government"]
country: ["TH"]
langs: ["common"]
quality: 90
url: "https://registry.apicrafter.io/datatype/th_province_code"
---

# Thai province code (`th_province_code`)

> **Draft.** Draft records have not been reviewed yet and may be incomplete or wrong; do not treat them as authoritative for legal or compliance decisions.

Two-digit code of a province of Thailand in the administrative area codes of the Department of Provincial Administration, the same digits as in ISO 3166-2 (TH-10 is Bangkok, TH-83 Phuket). The first digit is the region group: 1 and 2 the centre and east, 3 and 4 the north-east, 5 and 6 the north, 7 the west, 8 and 9 the south. There are 77 codes; 28, 29, 59, 68, 69, 78, 79 and 87 to 89 are not used. The code starts the district code (th_district_code), the subdistrict code (th_subdistrict_code) and the postal code area.

- Personal data (PII): no
- Categories: Geographic identifiers (geo), Government related (government)
- Countries: Thailand (TH)
- Languages: Common to most languages (common)
- Classification: identifier

## Detection

Regular expression (Python `re`):

```
^(?:1[0-9]|2[0-7]|[34][0-9]|5[0-8]|6[0-7]|7[0-7]|8[0-6]|9[0-6])$
```

## Examples

- `10` — Bangkok
- `83` — Phuket
- `55` — Nan
- `28` (invalid example) — not assigned

## Metacrafter rules

1 rules: 1 match the field name, 0 match values.

- `thprovincecodebyname` (field, `th/th_codes.yaml`)

## Supported by tools

- [`metacrafter`](https://registry.apicrafter.io/tool/metacrafter.md)

## Translations

- th: รหัสจังหวัด
- ru: Код провинции Таиланда

## Sources

- wikipedia: <https://en.wikipedia.org/wiki/ISO_3166-2:TH>

## Quality

Score 90/100. Missing: mapping (Wikidata, Schema.org, ...).

JSON: <https://registry.apicrafter.io/api/v1/datatypes/th_province_code.json> · Edit: <https://github.com/apicrafter/metacrafter-registry/edit/main/data/datatypes/TH/geo/th_province_code.yaml>
