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

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

elgigi/iban
===========

Library to manipulate IBAN and BBAN of countries

v1.2.0(5mo ago)111.1k↓38.9%1MITPHPPHP ^8.1CI passing

Since Mar 15Pushed 5mo ago1 watchersCompare

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

READMEChangelog (9)Dependencies (1)Versions (10)Used By (0)

Iban
====

[](#iban)

[![Latest Version](https://camo.githubusercontent.com/01c52068badbfc5048eb81db40ed51fded76bcc790d90fe53f145a4bca78b1d9/687474703a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f656c676967692f6962616e2e7376673f7374796c653d666c61742d737175617265)](https://github.com/ElGigi/Iban/releases)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE)[![Build Status](https://camo.githubusercontent.com/42b6ec6a88d0d3bac228ec0133a1b34fa11103e99038481713b89c322dc17c00/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f456c476967692f4962616e2f74657374732e796d6c3f6272616e63683d6d61696e267374796c653d666c61742d737175617265)](https://github.com/ElGigi/Iban/actions/workflows/tests.yml?query=branch%3Amain)[![Codacy Grade](https://camo.githubusercontent.com/b50bd66bd9f28d6121e17364d768ef7d7d72761e57d86d4396ae67be8c7e458d/68747470733a2f2f696d672e736869656c64732e696f2f636f646163792f67726164652f30333930633261363065343234373330393865366537333862386664613931312f6d61696e2e7376673f7374796c653d666c61742d737175617265)](https://www.codacy.com/app/ElGigi/Iban)[![Total Downloads](https://camo.githubusercontent.com/8c4f47e6950da4839c5cdbc0f4a600d55fd583d75628c60482f7116c74a0e66d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f656c676967692f6962616e2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/elgigi/iban)

PHP Library to manipulate IBAN and BBAN of countries, with validation, parsing, JSON representation...

Installation
------------

[](#installation)

You can install the library with [Composer](https://getcomposer.org/):

```
composer require elgigi/iban
```

Usage
-----

[](#usage)

### Parsing

[](#parsing)

You can parse an IBAN with `Iban::parse()` method:

```
$iban = Iban::parse('FR14 2004 1010 0505 0001 3M02 606');
```

Or a BBAN with `Bban::parse()` method:

```
$bban = Bban::parse('2004 1010 0505 0001 3M02 606', Country::FR);
```

### IBAN and BBAN

[](#iban-and-bban)

Iban object is composed of 2 parts:

- `\ElGigi\Iban\Bban` object (representation of a BBAN)
- Check digits

`Bban` object is composed of multiple properties:

- Bank identifier
- Branch identifier [1](#user-content-fn-1-3c04506ca67352ad7521d30987b32e6f)
- Account number
- Check digits [1](#user-content-fn-1-3c04506ca67352ad7521d30987b32e6f)
- Currency [1](#user-content-fn-1-3c04506ca67352ad7521d30987b32e6f)
- Additional digits [1](#user-content-fn-1-3c04506ca67352ad7521d30987b32e6f)
- ...

Both object have `format()` method to have a string representation of object. This method accept a boolean parameter to have the "condensed" representation (without spaces).

### JSON

[](#json)

For IBAN, the JSON serialization give the IBAN string representation:

```
"FR14 2004 1010 0505 0001 3M02 606"
```

For BBAN, it's little different because, we need the country to build the BBAN object again, so the JSON representation is:

```
{
  "country": "FR",
  "bban": "2004 1010 0505 0001 3M02 606"
}
```

After is simple to use `parse()` methods of classes to build objects again.

### Validation

[](#validation)

#### Validation of IBAN

[](#validation-of-iban)

Call `Iban::isValid():bool` method to known if IBAN is valid.

Or use `IbanValidation::validate(): bool` static method to valid an IBAN object or string representation.

Also, you can construct an IBAN from BBAN without check digits, library guess them, example:

```
$iban = new Iban(Bban::parse('2004 1010 0505 0001 3M02 606', Country::FR));
print $iban->format(); // Output: 'FR14 2004 1010 0505 0001 3M02 606'
```

#### Validation of BBAN

[](#validation-of-bban)

Depends on banks and countries, BBAN validation is available with method `Bban::isValid()`

Or uses `BbanValidation::validate(): bool` static method to valid a BBAN object or string representation.

In case of bank haven't control on BBAN, the method return always TRUE.

### Country

[](#country)

An IBAN is associated to a country. A country is represented by `Country` enum. All countries with IBAN support are listed.

You can also use helpers static methods:

- `Country::sepaMembers(): array`: list of countries SEPA members
- `Country::from(string $iso): Country`: country enum value from ISO code

Or methods with country value (FR in example):

- `Country::FR->isSepaMember(): bool`: country is SEPA member?
- `Country::FR->getCurrency(): Currency`: main currency of country
- `Country::FR->getLanguage(): Language|Language[]`: language(s) of country
- `Country::FR->getLocale(): string|string[]`: locale(s) of country
- `Country::FR->getIbanRegex(): string`: IBAN regex of country

### Language

[](#language)

`Language` enum is a representation of languages of countries.

To find whose countries speak a language, you can use helper method:

`Language::fr->getCountries(): Country[]`

### Currency

[](#currency)

`Currency` enum is a representation of currency of countries.

To find whose countries have currency, you can use helper method:

`Currency::fr->getCountries(): Country[]`

Footnotes
---------

1. Depends on banks and countries [↩](#user-content-fnref-1-3c04506ca67352ad7521d30987b32e6f) [↩2](#user-content-fnref-1-2-3c04506ca67352ad7521d30987b32e6f) [↩3](#user-content-fnref-1-3-3c04506ca67352ad7521d30987b32e6f) [↩4](#user-content-fnref-1-4-3c04506ca67352ad7521d30987b32e6f)

###  Health Score

46

—

FairBetter than 93% of packages

Maintenance70

Regular maintenance activity

Popularity27

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 90% 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 ~169 days

Recently: every ~270 days

Total

9

Last Release

168d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/18268216?v=4)[Ronan Giron](/maintainers/ElGigi)[@ElGigi](https://github.com/ElGigi)

---

Top Contributors

[![ElGigi](https://avatars.githubusercontent.com/u/18268216?v=4)](https://github.com/ElGigi "ElGigi (27 commits)")[![JDakkers](https://avatars.githubusercontent.com/u/139879235?v=4)](https://github.com/JDakkers "JDakkers (3 commits)")

---

Tags

ibanphp

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[rybakit/arguments-resolver

ArgumentsResolver allows you to determine the arguments to pass to a function or method.

26107.7k7](/packages/rybakit-arguments-resolver)[league/flysystem-adapter-decorator

A base implementation of a flysystem adapter decorator

17136.3k1](/packages/league-flysystem-adapter-decorator)

PHPackages © 2026

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