i want a list of all countries and states for free
interms of xml,html,word,doc,notepad, .sql format..

anybody have a list..?

kvprajapati commented: N/A +9

Dani AI

Generated

The replies already pointed to a few quick lists, but there’s a difference between a country list and a full global set of administrative subdivisions (states/provinces). found a JS-based list that’s handy for UIs, and pointed to a country lookup service — both useful for quick lookups but not ideal if the goal is a normalized, up-to-date machine-readable dataset you can import into a database or export as XML/SQL.

Best free sources to use (with different strengths):

  • GeoNames — provides tab-delimited dumps including countryInfo and admin1 (ready for import) (GeoNames export).
  • Natural Earth — public-domain admin-1 shapefiles (states/provinces) good for mapping and include names and ISO codes (Natural Earth downloads).
  • GADM — very detailed administrative boundaries where you need finer granularity; check license before redistribution (GADM).
  • ISO 3166-2 — the official subdivision standard; authoritative but the official ISO distribution may require purchase (ISO 3166 info).

Practical workflow notes:

  • Choose granularity: admin1 (states/provinces) is typical; admin2+ for counties/districts.
  • For text imports (GeoNames): import the tab files into MySQL/Postgres and join on ISO country code, then export to XML/SQL as needed. Example imports and conversions (very small examples):
    LOAD DATA INFILE 'admin1.txt' INTO TABLE admin1 FIELDS TERMINATED BY '\t' (code,name);
    ogr2ogr -f "GeoJSON" admin1.json ne_10m_admin_1_states_provinces.shp

Cautions and tips:

  • Use UTF-8 to preserve accents. Expect name variations and disputed/overlapping territories. Natural Earth is PD; verify GADM licensing for redistribution. If legal/official codes matter (regulatory, government use), rely on ISO 3166-2. For most web apps, GeoNames + Natural Earth gives a straightforward, free starting point that can be normalized into XML/.sql with simple scripts.

Recommended Answers

All 4 Replies

dude i already checked that out...
agree countries are fine but it only provides the
list of united states

can u help any more to find list of all the states of all countries..?

Download the GeoWorldMap

commented: N/A +9
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.