The world's most
complete open-source geographical database
Comprehensive geographical data covering 250+ countries, 5.3K+ states, and 153.8K+ cities. Available in 12 formats, trusted by thousands of developers worldwide.
The foundation for your product’s location data
Powers the entire CSC ecosystem — open source and free forever, with accuracy you can trust.
Completely Open Source
Licensed under ODbL — commercial use with proper attribution. No vendor lock‑in and full transparency.
12+ Ready-to-Use Formats
Pick the shape you need, from relational databases to documents and flat files.
Complete Global Coverage
250+ countries, 5,000+ states, and 153,000+ cities with coordinates, codes, and metadata.
Regular Monthly Updates
Automated and community‑verified updates ensure accuracy and freshness across the entire dataset.
Optimized File Sizes
Compressed, right‑sized downloads so you only pull what you need — no unnecessary overhead.
Community Driven
Built and maintained by a global community of developers with an open contribution model.
Choose Your Format
Download the complete database in your preferred format. All formats contain the same comprehensive data.
PostgreSQL
8MB compressed
Advanced database format
SQLite
7MB compressed
Serverless database file
SQL Server
7MB compressed
Enterprise-grade database
XML
25MB compressed
Structured markup format
YAML
18MB compressed
Human-readable config format
GeoJSON
24MB compressed
Mapping-ready geographic format
TOON
20MB compressed
LLM-optimized, ~40% fewer tokens
Parquet
27MB compressed
Columnar format for analytics
What's Included in Every Format
Easy Installation & Setup
Multiple ways to integrate the database into your project. Choose the method that works best for you.
# Clone the repository
git clone https://github.com/dr5hn/countries-states-cities-database.git
cd countries-states-cities-database
# Navigate to your preferred format
cd json # or mysql, psql, mongodb, etc.
# Or download specific files directly
wget https://github.com/dr5hn/countries-states-cities-database/raw/master/json/countries.json
wget https://github.com/dr5hn/countries-states-cities-database/raw/master/json/states.json
wget https://github.com/dr5hn/countries-states-cities-database/raw/master/json/cities.jsonAll packages are MIT licensed. Database data is licensed under ODbL-1.0.
Explore from your terminal
Search, explore, and generate code for geographic data — right from your terminal.
$ csc search "tokyo"
┌──────────┬────────────┬─────────┐
│ Name │ State │ Country │
├──────────┼────────────┼─────────┤
│ Tokyo │ Tokyo │ Japan │
└──────────┴────────────┴─────────┘
$ csc exploreJoin Our Growing Community
Thousands of developers worldwide contribute to and benefit from this open-source project