npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

bangladesh-districts-upazilas

v1.0.0

Published

Complete list of Bangladesh's 8 divisions, 64 districts, and 495 upazilas with accurate administrative data in both English and Bangla

Readme

Bangladesh Districts & Upazilas

A comprehensive NPM package containing accurate data of all 8 divisions, 64 districts, and 495 upazilas of Bangladesh with both English and Bangla names.

NPM Version Downloads License

✨ Features

  • Complete Data: All 8 divisions, 64 districts, and 495 upazilas
  • Bilingual Support: Both English and Bangla names included
  • Updated Spellings: Uses 2018 government-updated spellings (Chattogram, Barishal, etc.)
  • Search Functionality: Search districts and upazilas easily
  • Validation Methods: Check if district/upazila names are valid
  • Zero Dependencies: Lightweight with no external dependencies
  • TypeScript Ready: Type definitions included
  • Government Verified: Data sourced from official Bangladesh government portals

📦 Installation

npm install bangladesh-districts-upazilas

🚀 Quick Start

const bdGeo = require("bangladesh-districts-upazilas");

// Get all districts
const districts = bdGeo.getAllDistricts();
console.log(districts.length); // 64

// Get districts by division
const dhakaDistricts = bdGeo.getDistrictsByDivision("Dhaka");
console.log(dhakaDistricts.length); // 13

// Get upazilas by district
const dhakaUpazilas = bdGeo.getUpazilasByDistrict("Dhaka");
console.log(dhakaUpazilas.length); // 5

// Search functionality
const results = bdGeo.searchDistricts("Chatt");
console.log(results); // Returns Chattogram district

// Validation
const isValid = bdGeo.isValidDistrict("Dhaka"); // true

📚 API Documentation

Divisions

getAllDivisions()

Returns all 8 divisions of Bangladesh.

const divisions = bdGeo.getAllDivisions();
// Returns: Array of division objects

getDivisionByName(name)

Find division by name (English or Bangla).

const dhaka = bdGeo.getDivisionByName("Dhaka");
const sylhet = bdGeo.getDivisionByName("সিলেট");

getDivisionById(id)

Find division by ID.

const division = bdGeo.getDivisionById(1);

Districts

getAllDistricts()

Returns all 64 districts of Bangladesh.

const districts = bdGeo.getAllDistricts();

getDistrictByName(name)

Find district by English name.

const dhaka = bdGeo.getDistrictByName("Dhaka");
const chattogram = bdGeo.getDistrictByName("Chattogram");

getDistrictByBanglaName(banglaName)

Find district by Bangla name.

const dhaka = bdGeo.getDistrictByBanglaName("ঢাকা");

getDistrictsByDivision(divisionName)

Get all districts in a division.

const dhakaDistricts = bdGeo.getDistrictsByDivision("Dhaka");
const sylhetDistricts = bdGeo.getDistrictsByDivision("Sylhet");

getDistrictById(id)

Find district by ID.

const district = bdGeo.getDistrictById(18);

Upazilas

getAllUpazilas()

Returns all 495 upazilas of Bangladesh.

const upazilas = bdGeo.getAllUpazilas();

getUpazilasByDistrict(districtName)

Get all upazilas in a district.

const dhakaUpazilas = bdGeo.getUpazilasByDistrict("Dhaka");
const chattogramUpazilas = bdGeo.getUpazilasByDistrict("Chattogram");

getUpazilaByName(name)

Find upazila by English name.

const dhamrai = bdGeo.getUpazilaByName("Dhamrai");

getUpazilaByBanglaName(banglaName)

Find upazila by Bangla name.

const dhamrai = bdGeo.getUpazilaByBanglaName("ধামরাই");

getUpazilaById(id)

Find upazila by ID.

const upazila = bdGeo.getUpazilaById(1);

Search & Validation

searchDistricts(query)

Search districts by name.

const results = bdGeo.searchDistricts("Chatt");
// Returns districts containing "Chatt" in name

searchUpazilas(query)

Search upazilas by name.

const results = bdGeo.searchUpazilas("Sadar");
// Returns upazilas containing "Sadar" in name

isValidDistrict(name)

Check if district name is valid.

const isValid = bdGeo.isValidDistrict("Dhaka"); // true
const isInvalid = bdGeo.isValidDistrict("InvalidName"); // false

isValidUpazila(name)

Check if upazila name is valid.

const isValid = bdGeo.isValidUpazila("Dhamrai"); // true

Utilities

getCompleteData()

Get all data with metadata.

const completeData = bdGeo.getCompleteData();
// Returns: { metadata, divisions, districts, upazilas, statistics }

getStatistics()

Get package statistics.

const stats = bdGeo.getStatistics();
// Returns: { totalDivisions, totalDistricts, totalUpazilas, byDivision, ... }

📊 Data Structure

Division Object

{
  "id": 1,
  "name": "Dhaka",
  "banglaName": "ঢাকা"
}

District Object

{
  "id": 18,
  "name": "Dhaka",
  "banglaName": "ঢাকা",
  "divisionId": 3,
  "division": "Dhaka"
}

Upazila Object

{
  "id": 1,
  "name": "Dhamrai",
  "banglaName": "ধামরাই",
  "districtId": 18,
  "district": "Dhaka",
  "divisionId": 3,
  "division": "Dhaka"
}

🗺️ Administrative Structure

  • 8 Divisions: Barishal, Chattogram, Dhaka, Khulna, Mymensingh, Rajshahi, Rangpur, Sylhet
  • 64 Districts: All districts with updated spellings
  • 495 Upazilas: Complete list of all upazilas in Bangladesh

Updated District Spellings (2018)

  • Chattogram (formerly Chittagong)
  • Barishal (formerly Barisal)
  • Cumilla (formerly Comilla)
  • Jashore (formerly Jessore)
  • Bogura (formerly Bogra)

🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

🙏 Acknowledgments

  • Data sourced from Bangladesh Government Portal
  • Verified against official administrative records
  • Community contributions and feedback

📞 Support

If you have any questions or need help, please:


Made with ❤️ for the Bangladesh developer community