Malaysia Postal Codes Dataset
A reference of Malaysian postcodes with state-level administrative geography and WGS84 coordinates — 2,930 five-digit codes covering all 16 states and federal territories, as 2,931 postal-code × place rows.
Last updated: 2026-08-19 · Rows: 2,931 · Encoding: UTF-8 ·
Primary key: (postal_code, place_name)
Contents
| File | Description |
|---|---|
my.csv | The dataset (CSV, UTF-8) |
my.zip | The same three files, zipped |
datapackage.json | Machine-readable schema and metadata (Frictionless Data Package) |
validation_report.json | Frictionless validation report, run from inside this folder |
README.md | This document |
Fields
| # | Field | Type | Fill | Description |
|---|---|---|---|---|
| 1 | country_code | string | 100.0% | ISO 3166-1 alpha-2 — always MY |
| 2 | postal_code | string | 100.0% | Five-digit Malaysian postcode (leading zeros significant) |
| 3 | place_name | string | 100.0% | City/town — the tier postcodes are assigned at |
| 4 | admin_name1 | string | 100.0% | Negeri (state) / Wilayah Persekutuan (federal territory) |
| 5 | admin_code1 | string | 100.0% | ISO 3166-2:MY code, MY- prefix stripped (01–16) |
| 6 | admin_name2 | string | 0.0% | Reserved — see Administrative coverage below |
| 7 | admin_code2 | string | 0.0% | Reserved |
| 8 | admin_name3 | string | 0.0% | Reserved |
| 9 | admin_code3 | string | 0.0% | Reserved |
| 10 | latitude | number | 91.4% | WGS84 / EPSG:4326, decimal degrees, 5 dp |
| 11 | longitude | number | 91.4% | WGS84 / EPSG:4326, decimal degrees, 5 dp |
| 12 | accuracy | string | 91.4% | Coordinate accuracy tier, empty where no coordinate resolved |
| 13 | alternative_city_name | string | 0.0% | Reserved on this build pass |
Administrative coverage
Only the state tier (admin_name1 / admin_code1) is populated in this release. All 16
states and federal territories are covered, with the code kept one-to-one with the name
(ISO 3166-2:MY).
District (daerah) and mukim tiers are shipped as reserved, empty columns rather than omitted, so a future release can populate them without a schema change. No source found so far maps every place to its district or mukim at a licence that clears redistribution — this will be revisited in a future pass rather than approximated now.
Reading the file correctly
postal_code is a string with significant leading zeros. CSV is a typeless format and
quoting does not stop a type-inferring reader from turning "01000" into 1000. Read via
the datapackage schema, or force the string type:
import pandas as pd
df = pd.read_csv("my.csv", dtype={"postal_code": str})
from frictionless import Package
rows = Package("datapackage.json").get_resource("my").read_rows() # types honoured
Coordinates
Coordinates are WGS84 / EPSG:4326 in decimal degrees, rounded to 5 decimal places
(~1.1 m), resolved per postal code — never averaged or interpolated. Where a code was not
resolvable to a single confident point, latitude, longitude and accuracy are left
empty rather than filled with a guess; the three columns are always present or absent
together.
Characteristics worth knowing before you join
One postal code can serve more than one place. Postcode 40160 legitimately covers
both Sungai Buloh and Shah Alam in Selangor — that is why the primary key is
(postal_code, place_name) and not postal_code alone.
8.6% of rows carry no coordinate. Those postcodes did not resolve to a single confident point in the coordinate source; they ship with the postal and state fields populated and the three coordinate columns empty.
Coverage
| Measure | Value |
|---|---|
| Distinct postal codes | 2,930 |
| Distinct places | 390 |
| States / federal territories covered | 16 of 16 (100%) |
| Rows with a coordinate | 2,680 of 2,931 (91.4%) |
| Duplicate primary keys | 0 |
Sources and licence
This dataset is derived from CC BY 4.0 sources and is itself distributed under CC BY 4.0. Attribution is a condition of that licence and must be preserved in onward use:
- Postcode Dataset, Malaysian Communications and Multimedia Commission (MCMC), via data.gov.my, CC BY 4.0 — postal code, state and place.
- © GeoNames, CC BY 4.0 — coordinates, joined by postal code.
No data from share-alike sources (OpenStreetMap, Wikipedia) was used at any point, so nothing here is encumbered by ODbL or CC BY-SA.