DIGIPIN (Digital PIN)
is visualized as an geospatial addressing grid system that assigns a unique 10-digit alphanumeric code that represents a 4-meter by 4-meter(approx.) units, derived from the latitude and longitude coordinates of the unit. This alphanumeric code serves as the addressing reference for any specific location within the DIGIPIN system. DIGIPIN is a function of the latitude and longitude of the location represented as a grid value.
This open-source Node.js project exposes a public API to generate and decode DIGIPINs, supporting geolocation services, postal logistics, and spatial analysis applications.
The Department of Posts has undertaken an initiative to establish a Digital Public Infrastructure (DPI) for a standardized, geo-coded addressing system in India. DIGIPIN represents the foundation layer of this infrastructure.
Developed in collaboration with IIT Hyderabad and NRSC (National Remote Sensing Centre, ISRO), DIGIPIN is an open-source national-level addressing grid that serves as a key component of India's digital address ecosystem.
After extensive public consultation and expert review, the DIGIPIN Grid has been finalized to provide simplified addressing solutions for seamless delivery of public and private services, enabling "Address as a Service" (AaaS) across the country.
It provides a precise, user-friendly, and interoperable method for representing geographic locations, enabling seamless conversion between DIGIPIN codes and latitude/longitude coordinates for easy sharing, navigation, and digital addressing.
- Uniform Referencing Framework: Provides logical, precise location identification both offline and online
- GIS Integration: Bridges the gap between physical and digital addresses
- Cross-Sector Support: Enhances service delivery across emergency response, e-commerce, logistics, BFSI, and governance
- Policy Alignment: Complies with the National Geospatial Policy 2022, enriching India's geospatial knowledge stack
DIGIPIN simplifies address management and enhances service delivery accuracy, promoting a thriving geospatial ecosystem for India's digital economy.
- Encode: Convert latitude and longitude into a compact 10-character DIGIPIN
- Decode: Transform a DIGIPIN back to its center-point coordinates
- Lightweight: Optimized for performance and minimal resource usage
- RESTful API: Clean, standard-compliant endpoints
- Interactive Documentation: Comprehensive Swagger UI for easy exploration
- Production-Ready: Built with Node.js and Express for reliability
DIGIPIN shall be represented using the official DIGIPIN symbol adopted by the Department of Posts, Government of India, followed by a valid 10-character alphanumeric DIGIPIN.
For digital processing, storage, transmission, and interoperability, DIGIPIN shall be maintained as a continuous 10-character identifier containing only approved DIGIPIN characters. Hyphens (-) and other punctuation characters are not permitted. For display purposes, spaces may optionally be used in a 3-4-3 grouping pattern to improve readability.
| Representation | Status |
|---|---|
|
|
✅ Approved |
|
|
✅ Acceptable Display Format |
| C4P8K63M4M | ❌ DIGIPIN symbol missing |
|
|
❌ Hyphens are not permitted |
Note: For APIs, databases, integrations, and system-to-system exchange, DIGIPIN shall always be represented as a continuous 10-character alphanumeric identifier without spaces, hyphens, or other punctuation characters.
- Node.js (v14 or higher)
- npm (v6 or higher)
- Clone the Repository
git clone https://github.com/INDIAPOST-gov/digipin.git
cd digipin- Install Dependencies
npm install- Environment Setup
Create a .env file in the project root with the following variables:
PORT=5000
NODE_ENV=development
- Start the Server
npm startFor development with hot reloading:
npm run devThe API will be available at http://localhost:5000.
The project exposes two primary REST APIs: an encoding API to generate a DIGIPIN from latitude and longitude coordinates, and a decoding API to derive geographic coordinates from a valid DIGIPIN.
The API validates the supplied latitude and longitude coordinates and encodes them into a single unique 10-character alphanumeric DIGIPIN string, without any punctuations.
GET /api/digipin/encode?latitude=13.11179621&longitude=80.20264269
Example Response:
json
{
"digipin": "4T396F42L7"
}
The API validates the supplied 10-character alphanumeric DIGIPIN and decodes it into the corresponding geographic coordinates (latitude and longitude) representing the center point of the identified grid cell.
GET /api/digipin/decode?digipin=4P3JK852C9
Example Response:
json
{
"latitude": "12.971601",
"longitude": "77.594584"
}
Access the Swagger UI documentation at:
http://localhost:5000/api-docs
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
Please ensure your code adheres to the existing style and passes all tests.
This project is licensed under the Apache License, Version 2.0 - see the LICENSE file for details.
- Department of Posts, Government of India
- Indian Institute of Technology, Hyderabad
- National Remote Sensing Centre, ISRO
See CHANGELOG.md for version history and release notes.

