GitHub - sohag-pro/BD-JSON: Division, Discrict, Upazilla, Union in one JSON · GitHub
Skip to content

sohag-pro/BD-JSON

Folders and files

Repository files navigation

BD-JSON — Bangladesh Administrative Divisions in One JSON

The complete administrative hierarchy of Bangladesh — Divisions → Districts → Upazilas → Unions — in a single, nested JSON file. Every entry includes both English and Bengali (বাংলা) names plus the official *.gov.bd URL.

Level Count
Divisions (বিভাগ) 8
Districts (জেলা) 64
Upazilas (উপজেলা) 491
Unions (ইউনিয়ন) 4,540

File: bd.json · ~1.8 MB · valid UTF-8 JSON.


Why

A ready-to-use, offline dataset for any Bangladesh app that needs cascading location dropdowns, address forms, geo-tagging, or analytics — no API, no database seeding scripts, just one file.


Structure

The data is a single JSON array of divisions. Each level nests the next via a child array:

[Division] → districts[] → upazilas[] → unions[]

Example (trimmed)

[
  {
    "id": "1",
    "name": "Chattagram",
    "bn_name": "চট্টগ্রাম",
    "url": "www.chittagongdiv.gov.bd",
    "districts": [
      {
        "id": "1",
        "division_id": "1",
        "name": "Comilla",
        "bn_name": "কুমিল্লা",
        "lat": "23.4682747",
        "lon": "91.1788135",
        "url": "www.comilla.gov.bd",
        "upazilas": [
          {
            "id": "1",
            "district_id": "1",
            "name": "Debidwar",
            "bn_name": "দেবিদ্বার",
            "url": "debidwar.comilla.gov.bd",
            "unions": [
              {
                "id": "1",
                "upazilla_id": "1",
                "name": "Subil",
                "bn_name": "সুবিল",
                "url": "subilup.comilla.gov.bd"
              }
            ]
          }
        ]
      }
    ]
  }
]

Schema

Division

Field Type Description
id string Division ID
name string English name
bn_name string Bengali name
url string Official division portal
districts array Child districts

District

Field Type Description
id string District ID
division_id string Parent division id
name string English name
bn_name string Bengali name
lat string Latitude (may be empty)
lon string Longitude (may be empty)
url string Official district portal
upazilas array Child upazilas

Upazila

Field Type Description
id string Upazila ID
district_id string Parent district id
name string English name
bn_name string Bengali name
url string Official upazila portal
unions array Child unions

Union

Field Type Description
id string Union ID
upazilla_id string Parent upazila idnote the ll spelling
name string English name
bn_name string Bengali name
url string Official union portal

Note: All id values are strings, not numbers. id is unique only within its parent, not globally.


Divisions

id Name Bengali
1 Chattagram চট্টগ্রাম
2 Rajshahi রাজশাহী
3 Khulna খুলনা
4 Barisal বরিশাল
5 Sylhet সিলেট
6 Dhaka ঢাকা
7 Rangpur রংপুর
8 Mymensingh ময়মনসিংহ

Usage

JavaScript / Node

const bd = require('./bd.json');

// All division names
bd.map(d => d.name);

// Districts of Dhaka
const dhaka = bd.find(d => d.name === 'Dhaka');
dhaka.districts.map(d => d.name);

// Find a union by id within an upazila
const union = dhaka.districts[0].upazilas[0].unions
  .find(u => u.id === '1');

Browser (fetch)

const bd = await fetch('bd.json').then(r => r.json());

Python

import json

with open('bd.json', encoding='utf-8') as f:
    bd = json.load(f)

# Count unions
unions = sum(
    len(u['unions'])
    for div in bd
    for dist in div['districts']
    for u in dist['upazilas']
)
print(unions)  # 4540

Flatten to a lookup table (Python)

rows = []
for div in bd:
    for dist in div['districts']:
        for upa in dist['upazilas']:
            for uni in upa['unions']:
                rows.append({
                    'division': div['name'],
                    'district': dist['name'],
                    'upazila':  upa['name'],
                    'union':    uni['name'],
                })

Data Notes & Caveats

  • Coordinates: only districts carry lat/lon. Upazilas and unions have none. 15 districts have empty lat/lon strings — handle empties before parsing to float.
  • Union parent key is upazilla_id (double l), inconsistent with the upazilas array name and the upazila-level district_id pattern. Account for this when joining.
  • IDs are strings and only locally unique. Build a composite key (e.g. division_id/district_id/...) for a global identifier.
  • Spelling: some English names and URLs reflect older/official transliterations (e.g. Chattagram, occasional typos in source *.gov.bd URLs). Bengali names are authoritative.
  • Source URLs are *.gov.bd portals; some may be stale or redirect over time.

Contributing

Fixes welcome — corrected names, filled-in coordinates, broken URLs. Please:

  1. Keep the existing nesting and field names (don't rename upazilla_id; downstream consumers depend on it).
  2. Preserve UTF-8 Bengali text.
  3. Validate before committing: python3 -m json.tool bd.json > /dev/null.

License

MIT © 2026 Sohag Hasan. Free to use, modify, and distribute. Repo: https://github.com/sohag-pro/BD-JSON

About

Division, Discrict, Upazilla, Union in one JSON

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

Contributors