PHPackages                             ixnode/php-iban - 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. ixnode/php-iban

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

ixnode/php-iban
===============

PHP IBAN - This library provides a converter for account number, bank code and IBAN.

0.1.30(1y ago)46.0k↓24.4%3MITPHPPHP ^8.2

Since Sep 2Pushed 1y ago1 watchersCompare

[ Source](https://github.com/ixnode/php-iban)[ Packagist](https://packagist.org/packages/ixnode/php-iban)[ RSS](/packages/ixnode-php-iban/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (12)Versions (32)Used By (0)

PHP IBAN
========

[](#php-iban)

[![Release](https://camo.githubusercontent.com/4c64ed9cea5a8916c274aab07d778379c0f7bef2e14ba6a35e65687c0e09a4e1/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f72656c656173652f69786e6f64652f7068702d6962616e)](https://github.com/ixnode/php-iban/releases)[![](https://camo.githubusercontent.com/9e690f32409b6aedacc8515bbfd2dc5122d57fb83a95754fa70aa9577ce0c171/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652d646174652f69786e6f64652f7068702d6962616e)](https://github.com/ixnode/php-iban/releases)[![](https://camo.githubusercontent.com/078104398d0c2b6c663c035bd4fc4fedd84bc9742cd5f7b4b9defdd4e5ed77bb/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f7265706f2d73697a652f69786e6f64652f7068702d6962616e2e737667)](https://camo.githubusercontent.com/078104398d0c2b6c663c035bd4fc4fedd84bc9742cd5f7b4b9defdd4e5ed77bb/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f7265706f2d73697a652f69786e6f64652f7068702d6962616e2e737667)[![PHP](https://camo.githubusercontent.com/9ffda6c94e9634fafbd5ff0f68f442ccb690a9b88c8613f79b9c2ec14f5e596b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d253545382e322d3737376262332e7376673f6c6f676f3d706870266c6f676f436f6c6f723d7768697465266c6162656c436f6c6f723d353535353535267374796c653d666c6174)](https://www.php.net/supported-versions.php)[![PHPStan](https://camo.githubusercontent.com/29fcb055286f72da2b9c961f987152d1ac26a91d6cea221174abe7e01b5b7857/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048505374616e2d4c6576656c2532304d61782d3737376262332e7376673f7374796c653d666c6174)](https://phpstan.org/user-guide/rule-levels)[![PHPUnit](https://camo.githubusercontent.com/de101a446df383674178b80c404288664983cc6de751737d976d3df023942af9/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f504850556e69742d556e697425323054657374732d3662396264322e7376673f7374796c653d666c6174)](https://phpunit.de)[![PHPCS](https://camo.githubusercontent.com/ee1fdc76b568e414c96c160eb608dd4680475a67d714661b70a3b3c43f6ded54/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f50485043532d50535231322d3431366434652e7376673f7374796c653d666c6174)](https://www.php-fig.org/psr/psr-12/)[![PHPMD](https://camo.githubusercontent.com/223a2afede2bd4bf4d524b7610277838a5d75504f7087fc6c36847b81a80ab43/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048504d442d414c4c2d3336346138332e7376673f7374796c653d666c6174)](https://github.com/phpmd/phpmd)[![Rector - Instant Upgrades and Automated Refactoring](https://camo.githubusercontent.com/9c119c037099401c8a61bd1ce556a58158eb09bfe452b2d132b94500e6368714/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f526563746f722d504850253230382e322d3733613136352e7376673f7374796c653d666c6174)](https://github.com/rectorphp/rector)[![LICENSE](https://camo.githubusercontent.com/e5ea4c19422baff789692dd36ee83fc11b6dc67d211dd4a56b4c721e509e8b27/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f69786e6f64652f7068702d6170692d76657273696f6e2d62756e646c65)](https://github.com/ixnode/php-api-version-bundle/blob/master/LICENSE)

> This library provides a converter for account number, bank code and IBAN.

1. Usage
--------

[](#1-usage)

Some usage examples.

### 1.1 IBAN parser example

[](#11-iban-parser-example)

```
use Ixnode\PhpIban\Iban;
use Ixnode\PhpIban\Validator;

...

$iban = 'DE02120300000000202051';
$validator = new Validator(new Iban($iban));

print $validator->isValid() ? 'YES' : 'NO';
// (string) YES

print $validator->getAccount()->getAccountNumber();
// (string) 0000202051

print $validator->getIban()->getIbanFormatted();
// (string) DE02 1203 0000 0000 2020 51

etc.
```

### 1.2 Account number and bank code converter example (AT, CH, DE, LI, etc.)

[](#12-account-number-and-bank-code-converter-example-at-ch-de-li-etc)

```
use Ixnode\PhpIban\Account;

...

$accountNumber = '0000202051';
$bankCode = '12030000';
$countryCode = 'DE';
$account = new Account($accountNumber, $bankCode, $countryCode);

print $account->getIban();
// (string) DE02120300000000202051

print $account->getIbanFormatted();
// (string) DE02 1203 0000 0000 2020 51
```

### 1.3 Account number and bank code converter example (FR)

[](#13-account-number-and-bank-code-converter-example-fr)

```
use Ixnode\PhpIban\Account;
use Ixnode\PhpIban\Constant\IbanFormats;

...

$accountNumber = '00020053701';
$bankCode = '30027';
$countryCode = 'FR';
$branchCode = '17533';
$nationalCheckDigits = '59';
$account = new Account($accountNumber, $bankCode, $countryCode, [
    IbanFormat::KEY_BRANCH_CODE => $branchCode,
    IbanFormat::KEY_NATIONAL_CHECK_DIGITS => $nationalCheckDigits,
]);

print $account->getIban();
// (string) FR7630027175330002005370159

print $account->getIbanFormatted();
// (string) FR76 3002 7175 3300 0200 5370 159
```

2. Supported countries
----------------------

[](#2-supported-countries)

Checked countries and added tests (other countries might work too):

- AD (Andorra)
- AE (United Arab Emirates)
- AL (Albania)
- AT (Austria)
- AZ (Azerbaijan)
- BA (Bosnia and Herzegovina)
- BE (Belgium)
- BG (Bulgaria)
- BH (Bahrain)
- BR (Brazil)
- BY (Belarus)
- CH (Switzerland)
- CR (Costa Rica)
- CY (Cyprus)
- CZ (Czechia)
- DE (Germany)
- DK (Denmark)
- DO (Dominican Republic)
- EE (Estonia)
- EG (Egypt)
- ES (Spain)
- FI (Finland)
- FO (Faroe Islands)
- FR (France)
- GB (United Kingdom of Great Britain and Northern Ireland)
- GE (Georgia)
- GI (Gibraltar)
- GL (Greenland)
- GR (Greece)
- GT (Guatemala)
- HR (Croatia)
- HU (Hungary)
- IE (Ireland)
- IL (Israel)
- IQ (Iraq)
- IS (Iceland)
- IT (Italy)
- JO (Jordan)
- KW (Kuwait)
- KZ (Kazakhstan)
- LB (Lebanon)
- LC (Saint Lucia)
- LI (Liechtenstein)
- LT (Lithuania)
- LU (Luxembourg)
- LV (Latvia)
- MC (Monaco)
- ME (Montenegro)
- MD (Moldova)
- MK (North Macedonia)
- MR (Mauritania)
- MT (Malta)
- MU (Mauritius)
- NL (Netherlands)
- NO (Norway)
- PK (Pakistan)
- PL (Poland)
- PS (Palestine)
- PT (Portugal)
- QA (Qatar)
- RO (Romania)
- RS (Serbia)
- SA (Saudi Arabia)
- SC (Seychelles)
- SE (Sweden)
- SI (Slovenia)
- SK (Slovakia)
- SM (San Marino)
- ST (Sao Tome and Principe)
- SV (El Salvador)
- TN (Tunisia)
- TL (Timor-Leste)
- TR (Turkey)
- VG (Virgin Islands)
- UA (Ukraine)
- XK (Kosovo)

All added countries you can find here: `Ixnode\PhpIban\Constant\IbanFormats::IBAN_FORMATS`

See [https://en.wikipedia.org/wiki/International\_Bank\_Account\_Number#IBAN\_formats\_by\_country](https://en.wikipedia.org/wiki/International_Bank_Account_Number#IBAN_formats_by_country) to add more countries.

3. Installation
---------------

[](#3-installation)

```
composer require ixnode/php-iban
```

```
vendor/bin/php-iban -V
```

```
0.1.0 (2023-09-01 21:09:52) - Björn Hempel
```

4. Command line tool
--------------------

[](#4-command-line-tool)

### 4.1 Check IBAN number

[](#41-check-iban-number)

> Used to quickly check a given IBAN number.

```
bin/console iban:validate MU17BOMM0101101030300200000MUR
```

or within your composer project:

```
bin/console iban:validate MU17BOMM0101101030300200000MUR
```

```
Given IBAN:     MU17BOMM0101101030300200000MUR

Parsed IBAN
-----------
Valid:                           YES
Last error:                      N/A
IBAN:                            MU17BOMM0101101030300200000MUR
IBAN:                            MU17 BOMM 0101 1010 3030 0200 000M UR
Checksum:                        17
Format:                          MUkkbbbbbbsscccccccccccc000mmm
Parts:                           country-code=MU, iban-check-digits=17, national-bank-code=BOMM01, branch-code=01, account-number=101030300200, number=000, currency-code=MUR

Account
-------
Country:                         MU (Mauritius)
Checksum:                        17
Balance cccount number:          N/A
National bank code:              BOMM01
Account number:                  101030300200
National identification number:  N/A
Currency code:                   MUR
Owner account number:            N/A
Account number prefix:           N/A
Bic bank code:                   N/A
Branch code:                     01
Account type:                    N/A
National check digits:           N/A
IBAN (from account):             MU17BOMM0101101030300200000MUR
IBAN (from account):             MU17 BOMM 0101 1010 3030 0200 000M U
```

### 4.2 Generate IBAN number

[](#42-generate-iban-number)

> Used to quickly generate an IBAN number.

```
bin/console account-number:validate 0000202051 12030000
```

or within your composer project:

```
vendor/bin/php-iban account-number:validate 0000202051 12030000
```

```
Given account number: 0000202051
Given bank code:      12030000
Given country code:   DE

Parsed IBAN
-----------
IBAN:           DE02120300000000202051
Valid:          YES
Last error:     N/A
Country:        DE
Checksum:       02
Account number: 0000202051
Bank number:    12030000
```

5. Library development
----------------------

[](#5-library-development)

```
git clone git@github.com:ixnode/php-iban.git && cd php-iban
```

```
composer install
```

```
composer test
```

6. License
----------

[](#6-license)

This library is licensed under the MIT License - see the [LICENSE](/LICENSE) file for details.

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance31

Infrequent updates — may be unmaintained

Popularity30

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 98.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 ~9 days

Recently: every ~66 days

Total

31

Last Release

713d ago

### Community

Maintainers

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

---

Top Contributors

[![bjoern-hempel](https://avatars.githubusercontent.com/u/5531245?v=4)](https://github.com/bjoern-hempel "bjoern-hempel (63 commits)")[![VojtechFarek](https://avatars.githubusercontent.com/u/88597564?v=4)](https://github.com/VojtechFarek "VojtechFarek (1 commits)")

---

Tags

phpIBANbank codeaccount numberswift code

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan, Rector

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/ixnode-php-iban/health.svg)

```
[![Health](https://phpackages.com/badges/ixnode-php-iban/health.svg)](https://phpackages.com/packages/ixnode-php-iban)
```

###  Alternatives

[imanghafoori/laravel-anypass

A minimal yet powerful package to help you in development.

21421.6k](/packages/imanghafoori-laravel-anypass)

PHPackages © 2026

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