PHPackages                             codelibrary/countries - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [PDF &amp; Document Generation](/categories/documents)
4. /
5. codelibrary/countries

ActiveLibrary[PDF &amp; Document Generation](/categories/documents)

codelibrary/countries
=====================

List of world countries in JSON, CSV, XML and Yaml

v5.1.1-alpha.1(1y ago)091ODbL-1.0PHPPHP &gt;=8.2

Since Jun 8Pushed 12mo agoCompare

[ Source](https://github.com/CodeLibrary/countries)[ Packagist](https://packagist.org/packages/codelibrary/countries)[ Docs](https://mledoze.github.io/countries/)[ RSS](/packages/codelibrary-countries/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (3)Versions (5)Used By (1)

World countries in JSON, CSV, XML and YAML.
===========================================

[](#world-countries-in-json-csv-xml-and-yaml)

[![License](https://camo.githubusercontent.com/882ee7ca284ef627830091f16ede3a591f10509ecff60025167cc6928494ad6f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6d6c65646f7a652f636f756e74726965732e7376673f7374796c653d666c6174)](https://opendatacommons.org/licenses/odbl/1.0/)[![Build Status](https://github.com/mledoze/countries/workflows/CI/badge.svg)](https://github.com/mledoze/countries/actions)

[![Latest Stable Version](https://camo.githubusercontent.com/bd5ffbee79ab82ff1d15bb93c11b4f6d81d8485c51cd9d794db027823e103ed5/68747470733a2f2f696d672e736869656c64732e696f2f6e706d2f762f776f726c642d636f756e74726965732e7376673f7374796c653d666c6174)](https://www.npmjs.com/package/world-countries)[![npm downloads](https://camo.githubusercontent.com/ad4e21f64eaee3f1aea586455858ed42a7f361657cfe87f4848242ba645e0be6/68747470733a2f2f696d672e736869656c64732e696f2f6e706d2f646d2f776f726c642d636f756e74726965733f6c6162656c3d646f776e6c6f616473)](https://www.npmjs.com/package/world-countries)

[![Latest Stable Version](https://camo.githubusercontent.com/aff4f6db2a446108e01836a8e989fb4aaad1d7d6253ea92830eb89c1024490a1/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d6c65646f7a652f636f756e74726965732e7376673f7374796c653d666c6174)](https://packagist.org/packages/mledoze/countries)[![PHP from Packagist](https://camo.githubusercontent.com/9ef625846d85adf683677c8a9366f676bd2233df6bd0214c546277ebb73998da/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f6d6c65646f7a652f636f756e74726965732e737667)](https://packagist.org/packages/mledoze/countries)[![Packagist downloads](https://camo.githubusercontent.com/51a58a3b5d055f1ba5e0a632896f0da338ceadd01937d42f162504087fea8aca/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646d2f6d6c65646f7a652f636f756e74726965733f6c6162656c3d646f776e6c6f616473)](https://packagist.org/packages/mledoze/countries)

Countries data
--------------

[](#countries-data)

This repository contains a list of world countries, as defined by [ISO Standard 3166-1](https://en.wikipedia.org/wiki/ISO_3166-1), in JSON, CSV, XML and YAML. **Warning:** not all entities in this project are independent countries; refer to the `independent` property to know if the country is considered a sovereign state.

Each line contains the country:

- `name`
    - `common` - common name in english
    - `official` - official name in english
    - `native` - list of all native names
        - key: three-letter ISO 639-3 language code
        - value: name object
            - key: `official` - official name translation
            - key: `common` - common name translation
- country code top-level domain (`tld`)
- code ISO 3166-1 alpha-2 (`cca2`)
- code ISO 3166-1 numeric (`ccn3`)
- code ISO 3166-1 alpha-3 (`cca3`)
- code International Olympic Committee (`cioc`)
- ISO 3166-1 independence status (`independent`) (denotes the country is considered a sovereign state)
- ISO 3166-1 assignment status (`status`)
- UN Member status (`unMember`)
- [UN Regional Group](https://en.wikipedia.org/wiki/United_Nations_Regional_Groups) (`unRegionalGroup`)
- `currencies` - list of all currencies
    - key: ISO 4217 currency code
    - value: currency object
        - key: `name` name of the currency
        - key: `symbol` symbol of the currency
- International Direct Dialing info (`idd`)
    - `root` - the root geographical code prefix. e.g. +6 for New Zealand, +4 for UK.
    - `suffixes` - list of all suffixes assigned to this country. 4 for NZ, 809, 829, and 849 for Dominican Republic.
- capital city(ies) (`capital`)
- alternative spellings (`altSpellings`)
- region
- subregion
- list of official languages (`languages`)
    - key: three-letter ISO 639-3 language code
    - value: name of the language in english
- list of name translations (`translations`)
    - key: three-letter ISO 639-3 language code
    - value: name object
        - key: official - official name translation
        - key: common - common name translation
- latitude and longitude (`latlng`)
- `demonyms` - name of residents, translated &amp; genderized
    - key: three-letter ISO 639-3 language code
    - value: genderized demonym object
        - key: `f` (female) or `m` (male)
        - value: genderized demonym translation
- landlocked status (`landlocked`)
- land borders (`borders`)
- land area in km² (`area`)
- emoji flag (`flag`)
- calling codes (`callingCodes`)

#### Additional data

[](#additional-data)

The [data](https://github.com/mledoze/countries/tree/master/data) folder contains additional data such as the countries GeoJSON outlines and flags in SVG format.

Examples
--------

[](#examples)

### JSON

[](#json)

```
{
	"name": {
		"common": "Austria",
		"official": "Republic of Austria",
		"native": {
			"bar": {
				"official": "Republik Österreich",
				"common": "Österreich"
			}
		}
	},
	"tld": [".at"],
	"cca2": "AT",
	"ccn3": "040",
	"cca3": "AUT",
	"cioc": "AUT",
	"independent": true,
	"status": "officially-assigned",
	"unMember": true,
	"unRegionalGroup": "Western European and Others Group",
	"currencies": {"EUR": {"name": "Euro", "symbol": "\u20ac"}},
	"idd": {
		"root": "+4",
		"suffixes": ["3"]
	},
	"capital": ["Vienna"],
	"altSpellings": ["AT", "Osterreich", "Oesterreich"],
	"region": "Europe",
	"subregion": "Western Europe",
	"languages": {
		"bar": "Austro-Bavarian German"
	},
	"translations": {
		"cym": {"official": "Republic of Austria", "common": "Awstria"},
		"deu": {"official": "Republik Österreich", "common": "Österreich"},
		"fra": {"official": "République d'Autriche", "common": "Autriche"},
		"hrv": {"official": "Republika Austrija", "common": "Austrija"},
		"ita": {"official": "Repubblica d'Austria", "common": "Austria"},
		"jpn": {"official": "オーストリア共和国", "common": "オーストリア"},
		"nld": {"official": "Republiek Oostenrijk", "common": "Oostenrijk"},
		"por": {"official": "República da Áustria", "common": "Áustria"},
		"rus": {"official": "Австрийская Республика", "common": "Австрия"},
		"spa": {"official": "República de Austria", "common": "Austria"}
	},
	"latlng": [47.33333333, 13.33333333],
	"demonyms": {
		"fra": {
			"f": "Autrichienne",
			"m": "Autrichien"
		},
		"spa": {
			"f": "Austriaco",
			"m": "Austriaca"
		}
	},
	"landlocked": true,
	"borders": ["CZE", "DEU", "HUN", "ITA", "LIE", "SVK", "SVN", "CHE"],
	"area": 83871,
	"callingCodes": ["+43"]
	"flag": "\ud83c\udde6\ud83c\uddf9"
}
```

### GeoJSON and TopoJSON outlines

[](#geojson-and-topojson-outlines)

See an example for Germany: [GeoJSON](https://github.com/mledoze/countries/blob/bb61a1cddfefd09ad5c92ad0a1effbfceba39930/data/deu.geo.json) or [TopoJSON](https://github.com/mledoze/countries/blob/442472de98e80f4a44f1028960dbb0dfb1d942fe/data/deu.topo.json).

### CSV

[](#csv)

```
"name.common","name.official","tld","cca2","ccn3","cca3","cioc","independent","status","unMember","currencies","idd.root","idd.suffixes","capital","altSpellings","region","subregion","languages","translations.ces.official","translations.ces.common","translations.deu.official","translations.deu.common","translations.est.official","translations.est.common","translations.fin.official","translations.fin.common","translations.fra.official","translations.fra.common","translations.hrv.official","translations.hrv.common","translations.hun.official","translations.hun.common","translations.ita.official","translations.ita.common","translations.jpn.official","translations.jpn.common","translations.kor.official","translations.kor.common","translations.nld.official","translations.nld.common","translations.per.official","translations.per.common","translations.pol.official","translations.pol.common","translations.por.official","translations.por.common","translations.rus.official","translations.rus.common","translations.slk.official","translations.slk.common","translations.spa.official","translations.spa.common","translations.swe.official","translations.swe.common","translations.urd.official","translations.urd.common","translations.zho.official","translations.zho.common","latlng","landlocked","borders","area","flag","demonyms.eng.f","demonyms.eng.m","demonyms.fra.f","demonyms.fra.m","callingCodes"
"Aruba","Aruba",".aw","AW","533","ABW","ARU","0","officially-assigned","0","AWG","+2","97","Oranjestad","AW","Americas","Caribbean","Dutch,Papiamento","Aruba","Aruba","Aruba","Aruba","Aruba","Aruba","Aruba","Aruba","Aruba","Aruba","Aruba","Aruba","Aruba","Aruba","Aruba","Aruba","アルバ","アルバ","아루바","아루바","Aruba","Aruba","آروبا","آروبا","Aruba","Aruba","Aruba","Aruba","Аруба","Аруба","Aruba","Aruba","Aruba","Aruba","Aruba","Aruba","اروبا","اروبا","阿鲁巴","阿鲁巴","12.5,-69.96666666","0","","180","🇦🇼","Aruban","Aruban","Arubaise","Arubais","+297"
"Afghanistan","Islamic Republic of Afghanistan",".af","AF","004","AFG","AFG","1","officially-assigned","1","AFN","+9","3","Kabul","AF,Afġānistān","Asia","Southern Asia","Dari,Pashto,Turkmen","Afghánská islámská republika","Afghánistán","Islamische Republik Afghanistan","Afghanistan","Afganistani Islamivabariik","Afganistan","Afganistanin islamilainen tasavalta","Afganistan","République islamique d'Afghanistan","Afghanistan","Islamska Republika Afganistan","Afganistan","Afganisztáni Iszlám Köztársaság","Afganisztán","Repubblica islamica dell'Afghanistan","Afghanistan","アフガニスタン・イスラム共和国","アフガニスタン","아프가니스탄 이슬람 공화국","아프가니스탄","Islamitische Republiek Afghanistan","Afghanistan","جمهوری اسلامی افغانستان","افغانستان","Islamska Republika Afganistanu","Afganistan","República Islâmica do Afeganistão","Afeganistão","Исламская Республика Афганистан","Афганистан","Afgánsky islamský štát","Afganistan","República Islámica de Afganistán","Afganistán","Islamiska republiken Afghanistan","Afghanistan","اسلامی جمہوریہ افغانستان","افغانستان","阿富汗伊斯兰共和国","阿富汗","33,65","1","IRN,PAK,TKM,UZB,TJK,CHN","652230","🇦🇫","Afghan","Afghan","Afghane","Afghan","+93"
"Angola","Republic of Angola",".ao","AO","024","AGO","ANG","1","officially-assigned","1","AOA","+2","44","Luanda","AO,República de Angola,ʁɛpublika de an'ɡɔla","Africa","Middle Africa","Portuguese","Angolská republika","Angola","Republik Angola","Angola","Angola Vabariik","Angola","Angolan tasavalta","Angola","République d'Angola","Angola","Republika Angola","Angola","Angola","Angola","Repubblica dell'Angola","Angola","アンゴラ共和国","アンゴラ","앙골라 공화국","앙골라","Republiek Angola","Angola","جمهوری آنگولا","آنگولا","Republika Angoli","Angola","República de Angola","Angola","Республика Ангола","Ангола","Angolská republika","Angola","República de Angola","Angola","Republiken Angola","Angola","جمہوریہ انگولہ","انگولہ","安哥拉共和国","安哥拉","-12.5,18.5","0","COG,COD,ZMB,NAM","1246700","🇦🇴","Angolan","Angolan","Angolaise","Angolais","+244"
⋮
```

### XML

[](#xml)

```

⋮

```

### YAML

[](#yaml)

```
- { name: { common: Aruba, official: Aruba, native: { nld: { official: Aruba, common: Aruba }, pap: { official: Aruba, common: Aruba } } }, tld: [.aw], cca2: AW, ccn3: '533', cca3: ABW, cioc: ARU, independent: false, status: officially-assigned, unMember: false, currencies: { AWG: { name: 'Aruban florin', symbol: ƒ } }, idd: { root: '+2', suffixes: ['97'] }, capital: [Oranjestad], altSpellings: [AW], region: Americas, subregion: Caribbean, languages: { nld: Dutch, pap: Papiamento }, translations: { ces: { official: Aruba, common: Aruba }, deu: { official: Aruba, common: Aruba }, est: { official: Aruba, common: Aruba }, fin: { official: Aruba, common: Aruba }, fra: { official: Aruba, common: Aruba }, hrv: { official: Aruba, common: Aruba }, hun: { official: Aruba, common: Aruba }, ita: { official: Aruba, common: Aruba }, jpn: { official: アルバ, common: アルバ }, kor: { official: 아루바, common: 아루바 }, nld: { official: Aruba, common: Aruba }, per: { official: آروبا, common: آروبا }, pol: { official: Aruba, common: Aruba }, por: { official: Aruba, common: Aruba }, rus: { official: Аруба, common: Аруба }, slk: { official: Aruba, common: Aruba }, spa: { official: Aruba, common: Aruba }, swe: { official: Aruba, common: Aruba }, urd: { official: اروبا, common: اروبا }, zho: { official: 阿鲁巴, common: 阿鲁巴 } }, latlng: [12.5, -69.96666666], landlocked: false, borders: {  }, area: 180, flag: 🇦🇼, demonyms: { eng: { f: Aruban, m: Aruban }, fra: { f: Arubaise, m: Arubais } }, callingCodes: ['+297'] }
- { name: { common: Afghanistan, official: 'Islamic Republic of Afghanistan', native: { prs: { official: 'جمهوری اسلامی افغانستان', common: افغانستان }, pus: { official: 'د افغانستان اسلامي جمهوریت', common: افغانستان }, tuk: { official: 'Owganystan Yslam Respublikasy', common: Owganystan } } }, tld: [.af], cca2: AF, ccn3: '004', cca3: AFG, cioc: AFG, independent: true, status: officially-assigned, unMember: true, currencies: { AFN: { name: 'Afghan afghani', symbol: ؋ } }, idd: { root: '+9', suffixes: ['3'] }, capital: [Kabul], altSpellings: [AF, Afġānistān], region: Asia, subregion: 'Southern Asia', languages: { prs: Dari, pus: Pashto, tuk: Turkmen }, translations: { ces: { official: 'Afghánská islámská republika', common: Afghánistán }, deu: { official: 'Islamische Republik Afghanistan', common: Afghanistan }, est: { official: 'Afganistani Islamivabariik', common: Afganistan }, fin: { official: 'Afganistanin islamilainen tasavalta', common: Afganistan }, fra: { official: "République islamique d'Afghanistan", common: Afghanistan }, hrv: { official: 'Islamska Republika Afganistan', common: Afganistan }, hun: { official: 'Afganisztáni Iszlám Köztársaság', common: Afganisztán }, ita: { official: "Repubblica islamica dell'Afghanistan", common: Afghanistan }, jpn: { official: アフガニスタン・イスラム共和国, common: アフガニスタン }, kor: { official: '아프가니스탄 이슬람 공화국', common: 아프가니스탄 }, nld: { official: 'Islamitische Republiek Afghanistan', common: Afghanistan }, per: { official: 'جمهوری اسلامی افغانستان', common: افغانستان }, pol: { official: 'Islamska Republika Afganistanu', common: Afganistan }, por: { official: 'República Islâmica do Afeganistão', common: Afeganistão }, rus: { official: 'Исламская Республика Афганистан', common: Афганистан }, slk: { official: 'Afgánsky islamský štát', common: Afganistan }, spa: { official: 'República Islámica de Afganistán', common: Afganistán }, swe: { official: 'Islamiska republiken Afghanistan', common: Afghanistan }, urd: { official: 'اسلامی جمہوریہ افغانستان', common: افغانستان }, zho: { official: 阿富汗伊斯兰共和国, common: 阿富汗 } }, latlng: [33, 65], landlocked: true, borders: [IRN, PAK, TKM, UZB, TJK, CHN], area: 652230, flag: 🇦🇫, demonyms: { eng: { f: Afghan, m: Afghan }, fra: { f: Afghane, m: Afghan } }, callingCodes: ['+93'] }
- { name: { common: Angola, official: 'Republic of Angola', native: { por: { official: 'República de Angola', common: Angola } } }, tld: [.ao], cca2: AO, ccn3: '024', cca3: AGO, cioc: ANG, independent: true, status: officially-assigned, unMember: true, currencies: { AOA: { name: 'Angolan kwanza', symbol: Kz } }, idd: { root: '+2', suffixes: ['44'] }, capital: [Luanda], altSpellings: [AO, 'República de Angola', "ʁɛpublika de an'ɡɔla"], region: Africa, subregion: 'Middle Africa', languages: { por: Portuguese }, translations: { ces: { official: 'Angolská republika', common: Angola }, deu: { official: 'Republik Angola', common: Angola }, est: { official: 'Angola Vabariik', common: Angola }, fin: { official: 'Angolan tasavalta', common: Angola }, fra: { official: "République d'Angola", common: Angola }, hrv: { official: 'Republika Angola', common: Angola }, hun: { official: Angola, common: Angola }, ita: { official: "Repubblica dell'Angola", common: Angola }, jpn: { official: アンゴラ共和国, common: アンゴラ }, kor: { official: '앙골라 공화국', common: 앙골라 }, nld: { official: 'Republiek Angola', common: Angola }, per: { official: 'جمهوری آنگولا', common: آنگولا }, pol: { official: 'Republika Angoli', common: Angola }, por: { official: 'República de Angola', common: Angola }, rus: { official: 'Республика Ангола', common: Ангола }, slk: { official: 'Angolská republika', common: Angola }, spa: { official: 'República de Angola', common: Angola }, swe: { official: 'Republiken Angola', common: Angola }, urd: { official: 'جمہوریہ انگولہ', common: انگولہ }, zho: { official: 安哥拉共和国, common: 安哥拉 } }, latlng: [-12.5, 18.5], landlocked: false, borders: [COG, COD, ZMB, NAM], area: 1246700, flag: 🇦🇴, demonyms: { eng: { f: Angolan, m: Angolan }, fra: { f: Angolaise, m: Angolais } }, callingCodes: ['+244'] }
```

Customising the output
----------------------

[](#customising-the-output)

The data files provided in the `dist` directory include all available fields, but is also possible to build a custom version of the data with certain fields excluded.

To do this, you will first need a working PHP installation, [composer](https://getcomposer.org) and a local copy of this repository. Once you have these, open a terminal in your local version of this project's root directory and run this command to install the necessary dependencies:

```
composer install
```

After this finishes, run the following command (here we will exclude the `tld` field from the output, but you can exclude any field you want):

```
php countries.php convert --exclude-field=tld
```

You can also exclude multiple fields:

```
php countries.php convert --exclude-field=tld --exclude-field=cca2

# Or using the shorter `-x` syntax:
php countries.php convert -x tld -x cca2
```

If you prefer to include only some fields (this can not be combined with `--exclude-field`):

```
php countries.php convert --include-field=name --include-field=area

# or using the shorter `-i` syntax:
php countries.php convert -i name -i area
```

The generated files are put into the `dist` directory, but you can change this to another existing directory:

```
mkdir foobar
php countries.php convert --output-dir=foobar
```

You can also choose to only generate some of the output formats:

```
mkdir foobar
php countries.php convert --format=json_unescaped --format=csv

# or using the shorter `-f` syntax:
php countries.php convert -f json_unescaped -f csv
```

Showcase
--------

[](#showcase)

Projects using this dataset:

- [REST Countries](https://restcountries.eu/)
- [International Telephone Input](https://intl-tel-input.com/)
- [Telephone JS](https://github.com/lukaswhite/telephones-js)
- [Countries of the World](http://countries.petethompson.net/)
- [Country Prefix Codes For Go](https://github.com/relops/prefixes)
- [Country Info Mapper in Go](https://github.com/pirsquare/country-mapper)
- [Visa requirements in JSON](https://github.com/StrudelInc/visas2)
- [Country picker modal for React Native](https://github.com/xcarpentier/react-native-country-picker-modal)
- [Agnostic Virtual Assistant](https://github.com/ava-ia/core)

How to contribute?
------------------

[](#how-to-contribute)

Please refer to [CONTRIBUTING](https://github.com/mledoze/countries/blob/master/CONTRIBUTING.md).

To do
-----

[](#to-do)

- add the type of the country (country, sovereign state, public body, territory, etc.)
- pull in data automatically from CLDR at build time (idea from @Munter, see #108)

Sources
-------

[](#sources)

 for currency codes.

Region and subregion are taken from .

GeoJSON outlines come from [http://thematicmapping.org/downloads/world\_borders.php](http://thematicmapping.org/downloads/world_borders.php).

The rest comes from Wikipedia.

Credits
-------

[](#credits)

Thanks to:

- @Glazz for his help with country calling codes
- @hexorx for his work ()
- @frederik-jacques for the capital cities
- @fayer for the population, geolocation, demonym and area data
- @ancosen for his help with the borders data
- @herrjemand for country names and various fixes
- all the contributors:

License
-------

[](#license)

See [LICENSE](https://github.com/mledoze/countries/blob/master/LICENSE).

Flags are not licensed under the ODbL license; see [https://en.wikipedia.org/wiki/Wikipedia:Copyright\_on\_emblems](https://en.wikipedia.org/wiki/Wikipedia:Copyright_on_emblems) for more information.

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance49

Moderate activity, may be stable

Popularity5

Limited adoption so far

Community21

Small or concentrated contributor base

Maturity42

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 65.4% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~162 days

Total

3

Last Release

383d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/2f323ed212f50a4035758f59d096b11fc9cb0430ea7d511ae092772367ebba0e?d=identicon)[codelibrary](/maintainers/codelibrary)

---

Top Contributors

[![mledoze](https://avatars.githubusercontent.com/u/576509?v=4)](https://github.com/mledoze "mledoze (393 commits)")[![yackermann](https://avatars.githubusercontent.com/u/1636116?v=4)](https://github.com/yackermann "yackermann (36 commits)")[![fayderflorez](https://avatars.githubusercontent.com/u/693342?v=4)](https://github.com/fayderflorez "fayderflorez (18 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (17 commits)")[![oscerd](https://avatars.githubusercontent.com/u/5106647?v=4)](https://github.com/oscerd "oscerd (14 commits)")[![zeravcic](https://avatars.githubusercontent.com/u/7994942?v=4)](https://github.com/zeravcic "zeravcic (13 commits)")[![blumk](https://avatars.githubusercontent.com/u/2436496?v=4)](https://github.com/blumk "blumk (12 commits)")[![jamespwilliams](https://avatars.githubusercontent.com/u/34778680?v=4)](https://github.com/jamespwilliams "jamespwilliams (10 commits)")[![petert82](https://avatars.githubusercontent.com/u/3646420?v=4)](https://github.com/petert82 "petert82 (9 commits)")[![Nabela](https://avatars.githubusercontent.com/u/17912441?v=4)](https://github.com/Nabela "Nabela (9 commits)")[![paulvollmer](https://avatars.githubusercontent.com/u/235200?v=4)](https://github.com/paulvollmer "paulvollmer (8 commits)")[![emilv](https://avatars.githubusercontent.com/u/1684914?v=4)](https://github.com/emilv "emilv (7 commits)")[![jremes-foss](https://avatars.githubusercontent.com/u/4118513?v=4)](https://github.com/jremes-foss "jremes-foss (6 commits)")[![alexsegura](https://avatars.githubusercontent.com/u/1162230?v=4)](https://github.com/alexsegura "alexsegura (4 commits)")[![martinheidegger](https://avatars.githubusercontent.com/u/914122?v=4)](https://github.com/martinheidegger "martinheidegger (4 commits)")[![stevep-arm](https://avatars.githubusercontent.com/u/40239816?v=4)](https://github.com/stevep-arm "stevep-arm (4 commits)")[![Strehk](https://avatars.githubusercontent.com/u/42637916?v=4)](https://github.com/Strehk "Strehk (4 commits)")[![michalvavra](https://avatars.githubusercontent.com/u/20018?v=4)](https://github.com/michalvavra "michalvavra (3 commits)")[![stephenpaulger](https://avatars.githubusercontent.com/u/187240?v=4)](https://github.com/stephenpaulger "stephenpaulger (3 commits)")[![cedric-anne](https://avatars.githubusercontent.com/u/33253653?v=4)](https://github.com/cedric-anne "cedric-anne (3 commits)")

---

Tags

jsonxmlyamlcountriescsvworld

### Embed Badge

![Health badge](/badges/codelibrary-countries/health.svg)

```
[![Health](https://phpackages.com/badges/codelibrary-countries/health.svg)](https://phpackages.com/packages/codelibrary-countries)
```

###  Alternatives

[mledoze/countries

List of world countries in JSON, CSV, XML and YAML

6.2k699.7k6](/packages/mledoze-countries)[faisalman/simple-excel-php

Easily parse / convert / write between Microsoft Excel XML / CSV / TSV / HTML / JSON / etc formats

582599.4k1](/packages/faisalman-simple-excel-php)[soapbox/laravel-formatter

A formatting library that converts data output between XML, CSV, JSON, TXT, YAML and a few others.

2501.1M12](/packages/soapbox-laravel-formatter)[rodenastyle/stream-parser

PHP Multiformat Streaming Parser

443195.7k2](/packages/rodenastyle-stream-parser)[dracoblue/craur

A lossless xml to json and json to xml converter (and csv/xlsx/yaml). Writing PHP Json/Xml/Csv/Yaml/excel Importers made easy

4643.1k2](/packages/dracoblue-craur)[ee/dataexporter-bundle

Easy export data to CSV, XML, HTML, JSON or XLS

4982.5k](/packages/ee-dataexporter-bundle)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
