🇧🇩
$ npm install bangladesh-geo-data

Complete Bangladesh
Geo Dataset

Divisions, districts, upazilas, unions, city corporations, wards & thanas — all in one TypeScript-ready npm package with zero dependencies.

Get Started View on npm ↗
8Divisions
64Districts
495Upazilas
4,599Unions
12City Corps
462Wards
639Thanas
Installation

Get up and running
in seconds

Zero dependencies. Works in Node.js, React, Next.js, and any TypeScript project.

$ npm install bangladesh-geo-data
$ yarn add bangladesh-geo-data
$ pnpm add bangladesh-geo-data
Data Levels

7 levels of
administrative data

Every level linked by consistent IDs — easy to traverse in any direction.

🗺️
Divisions
8 entries · div-01 → div-08
The 8 top-level administrative divisions of Bangladesh including Dhaka, Chattogram, Rajshahi and more.
div-XX
🏙️
Districts
64 entries · dis-01 → dis-64
All 64 districts (zilas) of Bangladesh, each linked to their parent division via divisionId.
dis-XX
🏡
Upazilas
495 entries · upa-001 → upa-495
All sub-districts including 2 newly added upazilas — Eidgaon (Cox's Bazar) and Bandar (Narayanganj).
upa-XXX
🏘️
Unions
4,599 entries · uni-0001 → uni-4599
Complete union data with post office names and postal codes for every union parishad in the country.
uni-XXXX
🏛️
City Corporations
12 entries · cc-01 → cc-12
All 12 city corporations (DNCC, DSCC, CCC, GCC, KCC, RCC, BCC, SCC, NCC, ComCC, MCC, RpCC).
cc-XX
🗳️
Wards
462 entries · ward-0001 → ward-0462
All city corporation wards. Chattogram's 41 wards are fully named (South Pahartali, Lalkhan Bazar etc.).
ward-XXXX
🚔
Thanas
639 entries · tha-0001 → tha-0639
Rural (495), sub-district (34) and metropolitan (110) thanas — 3 types covering all police jurisdictions.
tha-XXXX
Live Demo

Try the cascading
location selector

Select division → district → upazila to see the data structure in real time.

Interactive Explorer
// Select a location above to see the data output...
API Reference

Expressive,
type-safe functions

Every function returns fully typed objects. Works perfectly with autocomplete.

Divisions & Districts TypeScript
import {
  getAllDivisions,
  getDivisionById,
  getDistrictsByDivision,
  getDivisionWithDistricts
} from "bangladesh-geo-data";

// All 8 divisions
const divisions = getAllDivisions();

// Dhaka division
const dhaka = getDivisionById("div-01");

// All districts in Dhaka
const districts =
  getDistrictsByDivision("div-01");

// Division + nested districts
const withDist =
  getDivisionWithDistricts("div-01");
Unions & Postal Codes TypeScript
import {
  getUnionsByUpazila,
  getUnionsByPostalCode,
  getFullLocationByUnion
} from "bangladesh-geo-data";

// All unions in an upazila
const unions =
  getUnionsByUpazila("upa-001");

// By postal code
const postal =
  getUnionsByPostalCode("1350");

// Full 4-level hierarchy
const loc =
  getFullLocationByUnion("uni-0001");
// → { division, district, upazila, union }
City Corporations & Wards TypeScript
import {
  getCityCorporationByShortName,
  getCityCorporationWithWards,
  getWardByNumber,
  getFullUrbanLocationByWard
} from "bangladesh-geo-data";

// By short name
const dncc =
  getCityCorporationByShortName("DNCC");

// With all 54 wards
const full =
  getCityCorporationWithWards("cc-01");

// Specific ward by number
const w14 =
  getWardByNumber("cc-03", 14);
Thanas TypeScript
import {
  getRuralThanas,
  getMetropolitanThanas,
  getThanasByType,
  getThanasByCityCorporation,
  getThanaWithDetails
} from "bangladesh-geo-data";

// 495 rural thanas
const rural = getRuralThanas();

// 110 metro thanas
const metro = getMetropolitanThanas();

// DMP thanas (50 stations)
const dmp =
  getThanasByCityCorporation("cc-01");
Search (EN + বাংলা) TypeScript
import {
  searchUnions,
  searchUpazilas,
  searchDistricts,
  searchThanas,
  searchWards
} from "bangladesh-geo-data";

// English search
searchUpazilas("Dhaka");
searchThanas("Mirpur");
searchWards("Pahartali");

// Bengali search
searchDistricts("সিলেট");
searchUnions("সুবিল");
TypeScript Types Types
import type {
  Division, District,
  Upazila, Union,
  CityCorpration, Ward,
  Thana, ThanaType,
  FullLocation,
  FullUrbanLocation,
  ThanaWithDetails
} from "bangladesh-geo-data";

// ThanaType union type
type ThanaType =
  | "rural"
  | "sub-district"
  | "metropolitan";
Thana Types

3 thana types,
639 total

The 639 thanas are structured across three distinct categories reflecting real police jurisdiction types.

495 "rural" One per upazila — same name and boundary as the upazila, linked via upazilaId
34 "sub-district" Additional police stations within large upazilas e.g. Bangrabazar within Muradnagar
110 "metropolitan" City corporation thanas — DMP (50), CMP (16), KMP (8), GMP (8), BMP (8), SMP (6), RPMP (6)…
ID Reference

Consistent ID
format across all levels

Level Pattern Example Count
Divisiondiv-XXdiv-018
Districtdis-XXdis-1764
Upazilaupa-XXXupa-001495
Unionuni-XXXXuni-00014,599
City Corporationcc-XXcc-0112
Wardward-XXXXward-0112462
Thanatha-XXXXtha-0530639