A comprehensive IBAN validator for Dart and Flutter. Supports all 94 official ISO 13616 countries plus 22 experimental countries (111 country codes total), covering every nation that uses IBAN for banking transactions — including Eurozone, Middle East, Africa, and the Americas.
# iban_validator
A comprehensive, **zero-dependency** IBAN validator for **Dart** and **Flutter**.
Built on the ISO 7064 MOD-97-10 algorithm and the official SWIFT IBAN registry, it covers every country in the world that uses IBAN for banking transactions — from Germany and the UK to Saudi Arabia, Ivory Coast, and Brazil.
```dart
IbanValidator.isValid('DE89 3704 0044 0532 0130 00'); // true ✓
IbanValidator.isValid('GB29 NWBK 6016 1331 9268 19'); // true ✓
IbanValidator.isValid('DE99 3704 0044 0532 0130 00'); // false ✗ bad checksum
```
---
## Features
- ✅ **116 country codes** — 94 official ISO 13616 countries + 22 experimental (full list below)
- ✅ **Typed error enum** — know exactly why an IBAN failed, not just that it did
- ✅ **Rich country metadata** — name, IBAN length, SEPA membership, and a sample IBAN per country
- ✅ **Input-tolerant** — strips spaces and handles lowercase automatically
- ✅ **Pure Dart** — no Flutter dependency, runs on mobile, web, desktop, and server
- ✅ **Zero dependencies** — nothing in `dependencies:`, only `test` and `lints` in dev
- ✅ **Every registry example tested** — the test suite validates the sample IBAN for all 116 countries
---
## Table of contents
- Installation
- Quick start
- Flutter usage
- API reference
- isValid
- validate
- IbanValidationResult
- IbanValidationError
- getSupportedCountries
- getCountryInfo
- IbanCountryInfo
- Other helpers
- Error handling patterns
- How IBAN validation works
- Supported countries
- Contributing
- License
---
## Installation
Add `iban_validator` to your `pubspec.yaml`:
```yaml
dependencies:
iban_validator: ^1.0.2
```
Then install:
```sh
# Dart
dart pub get
# Flutter
flutter pub get
```
---
## Quick start
```dart
import 'package:iban_validator/iban_validator.dart';
void main() {
// ── Simple boolean check ───────────────────────────────────────────────────
print(IbanValidator.isValid('DE89 3704 0044 0532 0130 00')); // true
print(IbanValidator.isValid('GB29 n …