Create Full Country Listbox

Different content, formats and target languages

This website offers the possibility to download various lists of all countries in different formats and target languages as a ZIP file: World countries.

There are numerous contents to choose from:

  • only recognized states or
  • all countries.

As well as different target languages and various output formats:

  • SQL,
  • CSV,
  • JSON or
  • PHP.

Download the country list as a CSV file

Here is a short guide on how to proceed with the download and what you have to do afterwards.

Option selection on the website and download the ZIP file

  • Select your desired language on the webpage just below the ‘Download’ section. To do this, click on the checkbox in the gray table header of the correspondingly named table (German).
  • Then deselect all checkboxes in the selected table, except for ‘World’ and ‘CSV’ of the same line.
  • Then press the ‘Download’ button at the bottom of the page to download the list as a ZIP file.

Edit the CSV file a bit

You then have to unpack the downloaded CSV file from the ZIP archive and do some post-processing.

Import CSV file to Excel (summary)

A brief summary of the necessary steps:

  • Import the ‘countries.csv’ file to Excel.
  • Set the ‘File origin (character encoding)’ to ‘56001 : Unicode (UTF-8)'.
  • Then completely ignore the header row and the first and last columns.
  • Swap the order of the two columns after the import is complete. The column with the 2-digit ISO abbreviations must be at the front and the column with the country name must be at the end.

To finish your work in Excel, save your changes in CSV format.

Import CSV File to Excel (Step by Step)

Below is a detailed ‘step by step’ guide with all the details for importing the country list into Excel. The description is based on the versions Excel 2007 and Excel 2010.

  • Unzip the downloaded ZIP file and open the File ‘countries.csv’ (in case of German ‘…\world-countries\data\de\countries.csv’) in Microsoft Excel in the following way.
  • Start Excel with a new blank workbook.
  • From the ‘Data’ tab, select the ‘From Text’ option in the ‘Retrieve External Data’ section.
  • The ‘Import text file’ dialog opens.
    Select the file to be opened here and press the ‘Import’ button.
  • Text Conversion Wizard - Step 1 of 3:
    • Set the ‘File origin (character encoding)’ to ‘56001 : Unicode (UTF-8)'.
      This entry appears near the bottom of the list.
    • Set ‘Start import at line’ to 2.
      The first row contains the column titles.
    • Proceed with the ‘next’ button.
  • Text Conversion Wizard - Step 2 of 3:
    • Set the delimiter to comma instead of tab-stop.
    • Proceed with the ‘next’ button.
  • Text Conversion Wizard - Step 3 of 3:
    • Select the first column (id) under ‘Data preview’ and set ‘Column data format’ to ‘Do not import columns’.
    • Select the fourth column (alpha3) under ‘Data preview’ and set ‘Column data format’ to ‘Do not import columns’.
    • Confirm the wizard with the ‘Finish’ button.
    • Confirm the ‘Import data’ dialog with the preselection ‘Existing worksheet’ with the ‘OK’ button.

Brief editing of the data in Excel

  • Move the back of the two imported columns (with the 2-digit country codes) to the front.
    • Click on column header B.
    • Open the context menu with a right mouse click and select ‘Cut’.
    • Click on column header A.
    • Open the context menu with a right mouse click and select ‘paste cut cells’.

Save Excel table with country codes as CSV file

  • Click on the ‘Save’ icon in Excel.
  • In the following ‘Save as’ dialog set the file type to ‘CSV (comma separated) (*.csv)'.
  • Proceed with the ‘Save’ button.
  • Confirm the following two warning dialogs.

Import CSV file into Visforms

You can then import the CSV file into Visforms.