ibanchecker.cash
Developer ResourcesJune 3, 2026 · 7 min read

Top IBAN Validation Libraries for Node.js, Python, PHP, and Go in 2026

Comparison of ibantools, python-stdnum, php-iban, and go-iban — features, MOD-97 support, BIC lookup, TypeScript support — plus when to use a library vs. a hosted API.

Share

IBAN validation libraries let you embed MOD-97 check digit verification directly in your application without an external API call. This guide covers the most actively maintained libraries for Node.js, Python, PHP, and Go in 2026, compares them on the features that matter for production use, and explains when you should choose a library over a hosted API.

Node.js / JavaScript

ibantools

ibantools is the most widely adopted IBAN library in the JavaScript ecosystem. Written in TypeScript, it ships with type definitions and covers MOD-97 validation, BBAN format checking for all IBAN countries, IBAN formatting, and BIC validation.

npm install ibantools
import { isValidIBAN, electronicFormatIBAN, friendlyFormatIBAN, extractIBAN } from 'ibantools';

isValidIBAN('DE89370400440532013000');    // true
isValidIBAN('DE89370400440532013001');    // false (check digit wrong)

electronicFormatIBAN('DE89 3704 0044 0532 0130 00');
// 'DE89370400440532013000'

friendlyFormatIBAN('DE89370400440532013000');
// 'DE89 3704 0044 0532 0130 00'

const info = extractIBAN('GB29NWBK60161331926819');
// { valid: true, countryCode: 'GB', bban: 'NWBK60161331926819', ... }

Strengths: TypeScript-native, tree-shakeable, zero runtime dependencies, comprehensive BBAN format validation beyond just MOD-97, actively maintained. Limitation: No BIC-to-bank-name lookup — it validates BIC format but does not resolve the bank name.

iban (npm)

The iban package is a lighter alternative focused on core MOD-97 validation and formatting. Good for projects where bundle size is a constraint and you only need the validity check.

npm install iban
const IBAN = require('iban');

IBAN.isValid('DE89370400440532013000');        // true
IBAN.electronicFormat('DE89 3704 ...13000');  // 'DE89370400440532013000'
IBAN.printFormat('DE89370400440532013000');   // 'DE89 3704 0044 0532 0130 00'

Strengths: Tiny footprint, simple API, works in browser and Node. Limitation: No TypeScript definitions, no BBAN format checks beyond length — only MOD-97.

Python

python-stdnum

python-stdnum is a comprehensive library for validating and formatting identification numbers — IBANs, VAT IDs, ISBNs, and 200+ other formats. The IBAN module performs format validation, MOD-97 check digit verification, and BBAN format checks for all registered countries.

pip install python-stdnum
from stdnum import iban

iban.is_valid('DE89370400440532013000')   # True
iban.is_valid('DE89370400440532013001')   # False

iban.validate('DE89 3704 0044 0532 0130 00')
# 'DE89370400440532013000'  (returns normalized form or raises exception)

iban.format('DE89370400440532013000')
# 'DE89 3704 0044 0532 0130 00'

# Compact form (strips spaces)
iban.compact('DE89 3704 0044 0532 0130 00')
# 'DE89370400440532013000'

Strengths: Battle-tested, widely used in European fintech, BBAN format validation per country, raises typed exceptions on invalid input (useful for fail-fast validation). Limitation: No BIC lookup, broader dependency footprint due to the multi-format scope.

schwifty-iban

A lighter Python-only IBAN validator with a minimal API surface. Suitable when you want only IBAN validation without the broader stdnum dependency tree.

pip install schwifty
from schwifty import IBAN

iban = IBAN('DE89 3704 0044 0532 0130 00')
iban.is_valid        # True
iban.country_code    # 'DE'
iban.bic             # Attempts BIC derivation where possible
iban.formatted       # 'DE89 3704 0044 0532 0130 00'

Strengths: Object-oriented API, BIC derivation from BBAN where the bank code is embedded (works for some countries). Limitation: BIC derivation is not universally reliable — the embedded bank code is only the routing prefix, not the full BIC.

PHP

globalcitizen/php-iban

The most complete IBAN library in the PHP ecosystem. Covers validation, formatting, country-specific BBAN verification, human-readable descriptions, and machine-readable IBAN component extraction.

composer require globalcitizen/php-iban
<?php
require_once('php-iban.php');

verify_iban('DE89370400440532013000');    // true
verify_iban('DE89370400440532013001');    // false

machine_format_iban('DE89 3704 0044 0532 0130 00');
// 'DE89370400440532013000'

human_format_iban('DE89370400440532013000');
// 'DE89 3704 0044 0532 0130 00'

iban_get_parts('DE89370400440532013000');
// ['country' => 'DE', 'checksum' => '89', 'bban' => '370400440532013000', ...]

Strengths: Comprehensive, well-documented, supports BBAN decomposition, includes country registry data. Limitation: Procedural API style, not namespaced — may conflict in large projects without careful loading.

iban-validation (Laravel / Composer)

For Laravel projects, yard/laravel-iban provides a validation rule that integrates with Laravel's validator:

$request->validate([
    'iban' => ['required', 'iban'],
]);

Go

almerlucke/go-iban

The most actively maintained Go IBAN library. Pure Go, no CGO, performs MOD-97 validation and length checks against the full IBAN country registry.

go get github.com/almerlucke/go-iban
package main

import (
    "fmt"
    "github.com/almerlucke/go-iban/iban"
)

func main() {
    result, err := iban.NewIBAN("DE89370400440532013000")
    if err != nil {
        fmt.Printf("Invalid: %v\n", err)
        return
    }
    fmt.Printf("Valid IBAN: %s\n", result.PrintFormat)
    fmt.Printf("Country: %s\n", result.CountryCode)
}

Strengths: Idiomatic Go, returns typed error on invalid input, compact dependency. Limitation: No BIC lookup or bank metadata.

Comparison Table

LibraryLanguageMOD-97BBAN FormatBIC LookupTypeScript
ibantoolsJS/TSFormat only
iban (npm)JSLength onlyCommunity
python-stdnumPythonN/A
schwiftyPythonPartialN/A
php-ibanPHPN/A
go-ibanGoN/A

Library vs. API: When to Use Which

Use a library when:

  • You need offline or embedded validation — mobile apps, CLI tools, air-gapped environments.
  • You are doing high-volume preprocessing where network latency and cost per call matter.
  • You only need mathematical validity — you do not need bank name, BIC, or branch data.
  • You want zero external dependencies at runtime.

Use the ibanchecker.cash API when:

  • You need bank name, BIC, or branch metadata alongside the validity result — no library provides this.
  • You want automatic updates when new countries join the IBAN standard or banks update their codes.
  • You are building a web application or SaaS where an HTTP call is already part of the flow.
  • You process IBANs in multiple languages or services and want a single authoritative validation source.

Many production systems combine both: use a library as a local pre-filter to reject obvious malformed input without an API call, then call the API for valid-looking IBANs to retrieve bank metadata. This pattern reduces API costs while maintaining data quality.

Last updated: June 2026

Validate an IBAN instantly

Free IBAN checker — MOD-97 verification, bank lookup, and SEPA status across 84 countries.

Open IBAN Checker →

Related Articles