PHPackages                             league/iso3166 - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. league/iso3166

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

league/iso3166
==============

ISO 3166-1 PHP Library

4.4.0(4mo ago)70036.3M↓11.1%68[9 issues](https://github.com/alcohol/iso3166/issues)[4 PRs](https://github.com/alcohol/iso3166/pulls)20MITPHPPHP ^7.4 || ^8.0CI passing

Since Jun 30Pushed 1mo ago12 watchersCompare

[ Source](https://github.com/alcohol/iso3166)[ Packagist](https://packagist.org/packages/league/iso3166)[ Docs](https://github.com/alcohol/iso3166)[ GitHub Sponsors](https://github.com/alcohol)[ RSS](/packages/league-iso3166/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (4)Versions (23)Used By (20)

league/iso3166
==============

[](#leagueiso3166)

A PHP library providing ISO 3166-1 data.

Note

I do my best to keep the data up to date, but if you find any errors or omissions, please [open an issue](https://github.com/alcohol/iso3166/issues/new).

Important

This package is limited to [`ISO 3166-1`](https://en.wikipedia.org/wiki/ISO_3166-1) data, a subset of [`ISO 3166`](https://en.wikipedia.org/wiki/ISO_3166).

[![Code Coverage](https://camo.githubusercontent.com/48127bd335d105ba7f5947e5726d20aaa74b80d845913f11444e0f1d35c9c952/68747470733a2f2f636f6465636f762e696f2f67682f7468657068706c65616775652f69736f333136362f6272616e63682f6d61737465722f67726170682f62616467652e737667)](https://codecov.io/gh/thephpleague/iso3166)[![License](https://camo.githubusercontent.com/32f3719334017c911a635d1adf450f2178dfbf4c761c6b75ae19807b2a2e538b/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f7468657068706c65616775652f69736f333136362e737667)](https://camo.githubusercontent.com/32f3719334017c911a635d1adf450f2178dfbf4c761c6b75ae19807b2a2e538b/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f7468657068706c65616775652f69736f333136362e737667)

What is ISO 3166-1
------------------

[](#what-is-iso-3166-1)

> ISO 3166-1 is part of the ISO 3166 standard published by the International Organization for Standardization (ISO), and defines codes for the names of countries, dependent territories, and special areas of geographical interest. The official name of the standard is Codes for the representation of names of countries and their subdivisions – Part 1: Country codes. It defines three sets of country codes:
>
> - ISO 3166-1 alpha-2 – two-letter country codes which are the most widely used of the three, and used most prominently for the Internet's country code top-level domains (with a few exceptions).
> - ISO 3166-1 alpha-3 – three-letter country codes which allow a better visual association between the codes and the country names than the alpha-2 codes.
> - ISO 3166-1 numeric – three-digit country codes which are identical to those developed and maintained by the United Nations Statistics Division, with the advantage of script (writing system) independence, and hence useful for people or systems using non-Latin scripts.
>
> *-- [Wikipedia](http://en.wikipedia.org/wiki/ISO_3166-1)*

Installing
----------

[](#installing)

```
$ composer require league/iso3166
```

Using
-----

[](#using)

See [using](https://iso3166.thephpleague.com/using) section of the documentation.

Quick guide:

```
$data = (new League\ISO3166\ISO3166)->name($name);
$data = (new League\ISO3166\ISO3166)->alpha2($alpha2);
$data = (new League\ISO3166\ISO3166)->alpha3($alpha3);
$data = (new League\ISO3166\ISO3166)->numeric($numeric);
```

Data sample:

```
[
    'name' => 'Netherlands',
    'alpha2' => 'NL',
    'alpha3' => 'NLD',
    'numeric' => '528',
    'currency' => [
        'EUR',
    ]
]
```

Contributing
------------

[](#contributing)

Feel free to submit a pull request or create an issue.

License
-------

[](#license)

league/iso3166 is licensed under the MIT license.

Source(s)
---------

[](#sources)

- [ISO 3166-1](http://en.wikipedia.org/wiki/ISO_3166-1) by [Wikipedia](http://www.wikipedia.org) licensed under [CC BY-SA 3.0 Unported License](http://en.wikipedia.org/wiki/Wikipedia:Text_of_Creative_Commons_Attribution-ShareAlike_3.0_Unported_License)
- [www.iso.org](http://www.iso.org)

###  Health Score

73

—

ExcellentBetter than 100% of packages

Maintenance83

Actively maintained with recent releases

Popularity72

Solid adoption and visibility

Community46

Growing community involvement

Maturity78

Established project with proven stability

 Bus Factor1

Top contributor holds 73.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 ~182 days

Recently: every ~235 days

Total

20

Last Release

137d ago

Major Versions

1.0.2 → 2.0.02017-05-11

2.1.5 → 3.0.02020-12-05

3.0.0 → 4.0.02021-10-22

PHP version history (5 changes)1.0.0PHP ^5.5 || ^7.0

2.0.0PHP ^5.6 || ^7.0

2.1.2PHP ^7.0

3.0.0PHP ^7.3|^8.0

4.3.2PHP ^7.4 || ^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/b63efaf06b867a66bc5426b30d1405152ee1b21740a0dd1b14b5122cf58d779d?d=identicon)[alcohol](/maintainers/alcohol)

---

Top Contributors

[![alcohol](https://avatars.githubusercontent.com/u/21414?v=4)](https://github.com/alcohol "alcohol (124 commits)")[![8ctopus](https://avatars.githubusercontent.com/u/13252042?v=4)](https://github.com/8ctopus "8ctopus (9 commits)")[![Nielsvanpach](https://avatars.githubusercontent.com/u/10651054?v=4)](https://github.com/Nielsvanpach "Nielsvanpach (6 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (5 commits)")[![franmomu](https://avatars.githubusercontent.com/u/720690?v=4)](https://github.com/franmomu "franmomu (5 commits)")[![florentausha](https://avatars.githubusercontent.com/u/96052657?v=4)](https://github.com/florentausha "florentausha (2 commits)")[![bytestream](https://avatars.githubusercontent.com/u/1788397?v=4)](https://github.com/bytestream "bytestream (2 commits)")[![localheinz](https://avatars.githubusercontent.com/u/605483?v=4)](https://github.com/localheinz "localheinz (2 commits)")[![markitosgv](https://avatars.githubusercontent.com/u/1706470?v=4)](https://github.com/markitosgv "markitosgv (2 commits)")[![EnterVPL](https://avatars.githubusercontent.com/u/21365293?v=4)](https://github.com/EnterVPL "EnterVPL (1 commits)")[![drcreazy](https://avatars.githubusercontent.com/u/3186282?v=4)](https://github.com/drcreazy "drcreazy (1 commits)")[![arubacao](https://avatars.githubusercontent.com/u/7462542?v=4)](https://github.com/arubacao "arubacao (1 commits)")[![fulldecent](https://avatars.githubusercontent.com/u/382183?v=4)](https://github.com/fulldecent "fulldecent (1 commits)")[![julien-langlois](https://avatars.githubusercontent.com/u/8384955?v=4)](https://github.com/julien-langlois "julien-langlois (1 commits)")[![tomSasaki](https://avatars.githubusercontent.com/u/93813856?v=4)](https://github.com/tomSasaki "tomSasaki (1 commits)")[![xerc](https://avatars.githubusercontent.com/u/1372590?v=4)](https://github.com/xerc "xerc (1 commits)")[![alexandrmazur96](https://avatars.githubusercontent.com/u/20535375?v=4)](https://github.com/alexandrmazur96 "alexandrmazur96 (1 commits)")[![nikolaposa](https://avatars.githubusercontent.com/u/6012807?v=4)](https://github.com/nikolaposa "nikolaposa (1 commits)")[![npispas](https://avatars.githubusercontent.com/u/22989333?v=4)](https://github.com/npispas "npispas (1 commits)")[![duncan3dc](https://avatars.githubusercontent.com/u/546811?v=4)](https://github.com/duncan3dc "duncan3dc (1 commits)")

---

Tags

hacktoberfestlibrarycountriesISO 3166iso31663166-1

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/league-iso3166/health.svg)

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

###  Alternatives

[payum/iso4217

ISO 4217 PHP Library

16312.1M5](/packages/payum-iso4217)[dekor/php-array-table

PHP Library for printing associative arrays as text table (similar to mysql terminal console)

296.6M2](/packages/dekor-php-array-table)[juanparati/iso-codes

A PHP library that provides ISO codes, currencies, languages, timezones and additional geopolitical information

17146.4k](/packages/juanparati-iso-codes)[thalidzhokov/country-codes

CountryCodes PHP Class to get array of countries with ISO 3166-1 alpha-2, ISO 3166-1 alpha-3, ISO 3166-1 numeric and ISD codes it can provide following information related to country

13111.5k](/packages/thalidzhokov-country-codes)

PHPackages © 2026

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