Country-State-City Database

I wanted a drop down for country , state and city and doubted the possibility. I scanned the internet for few DBs, I got the country DBs from many websites but there was no single available through top google search allowing me a country state drop down.

I decided to search further and got the following things for :-

  1. – A free Geo IP country DB
  2. , also I checked my databases and found that I already have the city database.

Now the problem was how to map between country and state. I found the maxmind systems are following some standard codes ,

  • for country (it is ISO 3166 Country Codes)
  • for state it is following FIPS 10-4 Subcountry codes , which is a combination of country and region code , example for India the regions are :-
    IN,01,”Andaman and Nicobar Islands”
    IN,02,”Andhra Pradesh”
    IN,06,”Dadra and Nagar Haveli”

This solved my mapping problem but now I have to convert it to a DB to make it a perfect dropdown. I do not want it to refresh the page with every drop down so I have planned to use jpspan .

This will solve the problem and also I have asked my team to provide the DB for free.

Have a nice Day.

15 Replies to “Country-State-City Database”

  1. This is exactly what I have been looking for, it would be great if you could provide me with this database. or can you please let me know where I can download it from?

    thanks in advance.

    Best Regards,

  2. I am so sorry the link was not working , try

    – country DB is available at in csv format. I think I heard offering similar DBs but I am not sure (you can ask them at ).

    – city DB is available here at .

    – for state again you will have find a page in maxmind , once you have csv, you can just convert it into Db table easily.

    I think the best place is visitlab , if they offer it. They have a complete country tracking system in their free web analysing application.

    Let me know if you need more help.

  3. you are welcome, do let me know if you need more help. I had a talk with Visitlab admin and He is willing to offer some help. Contact him at visitlab and get more help.

  4. Try using pear classes for excel sheets, this is very simple to do, it is basically a csv (comma separated values). I wish I have time to work on this program but still will do if needed.

  5. Hello,

    I am looking for a Country/State/City database but I have no idea of how the mentioned scripts work. Anyone has a TXT database with this worldwide information?

    The format I need would be, for example:

    United States/Florida/Miami

    Thank you very much.


  6. check the maxmind, there you can get some of the info about US states but getting the information about other countries is difficult. You will have to buy those databases, I doubt the availability of any free DB. In case you run across one please let me know as well.

  7. Thanks for your comment. I believe I am solving the problem with the Dmoz category database (limitated to Regional). It is not complete for all countries, but it is complete for mayor countries.

  8. Oh so you are manually feeding it in? Hey Gustavo, lets do something good here, we will keep this country-wise data in human editable format, wiki+approval concept that people can keep adding new stuffs here. I think thats a damn neat idea.

  9. Great ideal… let me finish the manual edition and maybe we could split the database in countries, so that people could edit their own country data, adding even up to neighbourhoods 😉

Comments are closed.