High-Performance IBAN processing:
iban-commons

Ultra-fast. Allocation-free. Zero dependencies Java 8+. Immutable. 100% Coverage. PI-tested

Why iban-commons?

Developed with a focus on Clean Code, Compatibility, and Performance, this library is designed for top-performance systems and headache-free operation.

  • 1 Strict ISO 13616 Compliance
  • 2 National Check Digit Validation
  • 3 100% Test Coverage, PI-tested
  • 4 Compatible (Java 8+)
  • 5 Immutable & Thread-safe
  • 6 Zero Dependencies & Small Footprint
  • 7 Simple & intuitive, Android-friendly API
  • 8 Open Source - Free of Charge
Alpine Landscape

Part of the Java Ecosystem

iban-commons is integrated into these open source projects.

Quick Start

Maven Dependency

<dependency>
    <groupId>de.speedbanking</groupId>
    <artifactId>iban-commons</artifactId>
    <version>1.8.14</version>
</dependency>

Java Example

String s = "DE91100000000123456789";

if (Iban.isValid(s)) {
    System.out.println("Valid IBAN: " + s);
}

try {
    Iban iban = Iban.of(s);
    System.out.println("Country Code: " + iban.getCountryCode()); // DE
    System.out.println("Check Digits: " + iban.getCheckDigits()); // 91
    System.out.println("BBAN        : " + iban.getBban());        // 100000000123456789
} catch (InvalidIbanException ex) {
    System.err.println("Invalid IBAN: " + ex);
}
More Examples

What's New in 1.8.14

Android API 24

The core module runs on Android from API level 24 (Android 7.0) without core library desugaring. Up to 1.8.13 it needed API level 26, since it used ThreadLocal.withInitial and created java.time.YearMonth values when IbanRegistry was initialized. The build now checks the core classes against the Android API 24 signatures. Only IbanRegistry.getLastUpdate(), which returns a YearMonth, still needs API level 26; getLastUpdateYear() and getLastUpdateMonth() work on all levels.

What's New in 1.8.13

42% Smaller Jar

The core jar shrinks from 252 kB in 1.8.12 to 145 kB, smaller than 1.8.4 despite everything added since. The 112 generated country validator classes are replaced by a single CountryValidator that derives its checks from the BBAN pattern in IbanRegistry, and national check digit algorithms are plain methods shared by all countries using them.

Faster Validation

Validation is about 6% faster on valid and 9% faster on invalid IBANs than in 1.8.12. Every country is now checked by the same CountryValidator class, so the JIT sees a single call target instead of one per country. Allocation stays at 0 bytes per validation.

Less Memory for Bank Data

iban-commons-bankdata shares equal values such as bank names, BICs and cities among the records of a country. With all bundled countries loaded, the bank data takes 3.6 instead of 5.4 MB of heap.

Reproducible Builds

Building the same commit yields byte-identical jars: archive entries carry a fixed timestamp, and the manifests no longer contain machine-specific entries.

Breaking Changes

A few rarely used public types were removed or moved. IndexRange, RegexSimplifier and CharArrayWrapper in de.speedbanking.util are removed; for a CharSequence view on a char[], use CharBuffer.wrap(). InvalidBaseException moved from de.speedbanking.iban.util to de.speedbanking.util, and IbanPatternConverter.parseSegments() returns the new Segments type instead of List<Segment>.

What's New in 1.8.12

New Module: Bank Data Lookup

iban-commons-bankdata is a new module that resolves the BIC and bank name behind an IBAN or a raw country-specific bank code — self-hosted and open-source, with no third-party lookup service involved. Covers Germany, Austria, Switzerland, Czech Republic, Belgium, Poland, the Netherlands, Spain, and France, with an architecture built to extend to any ISO country. A bundled offline snapshot means lookups work immediately with zero network access; a local cache and a lazy, non-blocking background refresh keep the data current afterwards without ever blocking a lookup.

Optional<BankData> bank = BankDataLookup.byIban(Iban.of("DE89370400440532013000"));

bank.ifPresent(b -> {
    System.out.println(b.getBankName()); // "Commerzbank"
    System.out.println(b.getBic());      // "COBADEFFXXX"
    System.out.println(b.getCity());     // "Köln"
});

German IBANs with Account Check

GermanIban is a validated German IBAN that also checks the account number against the check digit method the Bundesbank publishes for the bank. The method comes from the bundled bank data, the check itself from iban-commons-de-checkdigit.

GermanIban iban = GermanIban.of("DE89370400440532013000");
GermanAccountCheckResult result = iban.getAccountCheckResult(); // VALID

All German Check Digit Methods

iban-commons-de-checkdigit now implements all 144 assigned Bundesbank check digit methods (00 to 99, A0 to E4), up from 122, including the ESER methods 52 and 53. Every method the Bundesbank directory currently assigns to a bank is covered, and fifteen existing methods were corrected where they deviated from the specification. The test suite now checks every test account number the specification lists.

Faster IbanBuilder

IbanBuilder checks component values character by character against their pattern instead of using a regex, generates random characters only where no component is set, and works on a reused per-thread buffer. Building a DE IBAN from bank code and account number is about 2.6 times as fast as in 1.8.11 and allocates 120 instead of 564 bytes, against 1,604 bytes for iban4j, which it now outperforms by a factor of 2.4.

Iban iban = IbanRegistry.DE.<StandardIbanBuilder>builder()
    .bankCode("37040044")
    .accountNumber("532013000")
    .build(); // DE89370400440532013000

Smaller Iban Objects

The parts an Iban caches for its getters, such as getBankCode() or toFormattedString(), now live in a holder created on first access. An Iban whose parts are never requested takes 24 instead of 48 bytes on the heap.

What's New in 1.8.11

Check Digit Range Enforcement

A genuinely generated IBAN check digit is always in [02, 98] — 00, 01, and 99 can't occur. Validation now rejects those three values outright instead of trusting the raw mod-97 remainder alone, which some BBANs could coincidentally still satisfy.

IBAN Registry Release 103

IbanRegistry is now cross-checked against SWIFT IBAN Registry Release 103 (Sep 2026), up from Release 100. The only structural change: Brazil's bank identifier and account-type/control digits are now alphanumeric instead of numeric/alpha-only.

What's New in 1.8.10

New Module: German Account Check Digit

iban-commons-de-checkdigit is a new, standalone module implementing the Deutsche Bundesbank's “Prüfzifferberechnungsmethoden in der deutschen Kreditwirtschaft” — 122 of the 127 assignable check digit methods (00–99, A0–D9) used to verify a German domestic account number (“Kontonummer”) against a Bankleitzahl (BLZ). It operates purely on BLZ + Kontonummer + method code, has zero dependency on iban-commons or anything else, and does not select a method itself — only executes one you already know, e.g. from the Bundesbank's BLZ master-data file.

// method code "00", BLZ "10000000", Kontonummer "0532013000"
CheckDigitResult result = GermanAccountCheckDigit.verify("00", "10000000", "0532013000");

if (result.isValid()) {
    // check digit is internally consistent
}

What's New in 1.8.9

New: IbanBuilder

IbanRegistry.builder() returns a country-aware builder for constructing structurally valid, checksum-correct IBANs. Set only the parts you care about — bank code, account number, branch code, and country-specific fields such as account type or national code — and the rest is filled in with random, pattern-valid content.

Seven More Countries

Added Congo (CG), Côte d'Ivoire (CI), Guinea-Bissau (GW), Madagascar (MG), Mali (ML), Niger (NE) and Chad (TD) to the IbanRegistry.

Gap-Aware Component Formatting

Component string formatting now supports gap ranges, and IBAN length as well as component end indices are derived directly from structure patterns instead of being hardcoded per country.

Data & API Cleanup

CountryUtil was merged into Country, corrected Bolivia's name, Tonga's continent and the ZWL→ZWG currency rename, and fixed a KGS typo. New PatternCache and RegexSimplifier utilities back the faster pattern matching used by the new builder.

What's New in 1.8.8

Optimized BIC Validation Pipeline

Extended the zero-allocation principles fully to the BIC parsing and validation pipeline.

Updated Performance Benchmarks

Integrated the latest JMH benchmark results (June 2026) for both the IBAN and BIC validation paths, confirming absolute zero-allocation (0 B/op) performance and leading execution speeds.

What's New in 1.8.7

Allocation-Free Validation Path

IbanValidationResult now caches one singleton per IbanValidationError constant at class-load time. Failed validations on the hot path no longer allocate. Iban.toFormattedString() caches its result in a transient volatile field

Cleaner validate() API

New allocation-free Iban.validate() and Bic.validate() methods throw on invalid input without constructing an instance — ideal for strict input guards.

Internal Refactoring & Correctness

Objects.hash() replaced with the classic Bloch prime-accumulation pattern. IbanRegistry.ALL_COUNTRIES is now a shared, alphabetically pre-sorted array. PMD upgraded to 7.24.0, pitest-maven to 1.23.1.

What's New in 1.8.6

Invalid IBAN Generator

New utilities for generating structurally invalid IBAN strings with controlled sabotage strategies — invaliding check digits, corrupting BBAN segments, and mutating country codes. Purpose-built for negative test suites and fuzz harnesses.

Error-Prone Integration

The build now integrates Error‑Prone with error‑prone‑support, catching bug patterns at compile time that unit tests alone cannot surface. Even stronger code quality enforcement is part of every build, not just CI.

Dedicated JUnit Extensions Module

JUnit 5 extensions (enhanced IBAN and BIC assertions, parameterized test support) have been extracted into a standalone iban-commons-junit sub-module. Test infrastructure is now decoupled from the core library — include it only where needed.

What's New in 1.8.5

Near-Zero Allocation

The entire internal validation pipeline has been migrated from CharSequence to char[] across all country validators and the NationalCheckDigitCalculator SPI. This eliminates virtual dispatch on charAt() and allows the JIT to apply scalar replacement, reducing measured heap allocation to effectively zero (< 0.001 B/op). Backward compatibility is preserved.

Expanded Public API

Bic, IbanRegistry, RandomBic, and the Formatter type are now part of the stable public API. The RandomIban factory methods have been replaced by a fluent builder for more explicit and composable generation.

  • RandomIban.builder()   .country("DE").build()
  • RandomIban.builder()   .sepaOnly().random(rng).build()

Immutable IbanConfig

IbanConfig has been redesigned from a mutable enum to an immutable class using the freeze pattern. Configuration is locked at startup via IbanConfig.freeze(); concurrent reads thereafter require no synchronization and mutation is permanently blocked.

What's New in 1.8.4

Country-Agnostic Random IBANs

Two new factory methods on RandomIban generate valid IBANs without requiring a specific country:

  • RandomIban.of() — any supported country
  • RandomIban.ofSepa() — SEPA countries only

Iso3166Alpha2 Enum & BIC Validation

A new Iso3166Alpha2 enum provides a type-safe representation of all registered ISO 3166 Alpha-2 country codes. BIC country code validation is now backed by this enum, eliminating string-based lookups and tightening correctness guarantees at compile time.

Reduced Bic Memory Footprint

The internal Bic representation has been slimmed down by removing a redundant char[] field and eliminating eager computation of the padded BIC-11 form. Both are now derived on demand, reducing per-instance heap allocation with no change to the public API.

What's New in 1.8.3

Serialization Security

Iban and Bic now use the Serialization Proxy Pattern (Memento). Byte-stream injection attacks are blocked: deserialization always re-validates through the full ISO 7064 Mod 97-10 pipeline. Direct deserialization of raw instances throws InvalidObjectException.

SECURITY.md

Android Compatibility

New null-returning alternatives avoid java.time.YearMonth (requires API 26+):

  • IbanRegistry.getLastUpdateYear()
  • IbanRegistry.getLastUpdateMonth()

Feature Parity

All remaining gaps vs. alternative libraries are now closed. iban-commons leads on country coverage (120 vs. 111), BIC support, rich metadata, random IBAN generation, and validation error detail — now also matching on serialization hardening and Android-friendly API.

Performance

Leading Throughput

Outperforms all tested libraries, reaching 5.8 M ops/s on valid IBANs and 10.9 M ops/s on invalid ones, where fast-path rejection kicks in.

Up to 3.0× Faster

On the accept path, iban-commons is ~1.4× faster than jbanking and iban4j, ~1.9× faster than Apache Commons, and ~3.0× faster than Garvelink.

Zero Allocation

Exactly 0 B/op — the allocation-free validation pipeline eliminates all transient heap allocation on both paths. Competitors allocate 171–972 B/op.

Throughput Comparison

Operations per second (higher is better) — OpenJDK 25.0.3, Linux, single core
SerialGC  |  -XX:-StackTraceInThrowable  |  JMH: 3 forks × 5 iterations × 2 s  |  2026-10-25

Valid IBANs — accept path

iban-commons ~0 B/op
5,755,902 ops/s
jbanking 325 B/op
4,258,449 ops/s
iban4j 506 B/op
4,207,195 ops/s
3,052,124 ops/s
1,906,954 ops/s

Invalid IBANs — rejection path

iban-commons ~0 B/op
10,883,875 ops/s
jbanking 171 B/op
7,322,453 ops/s
6,065,384 ops/s
iban4j 972 B/op
2,089,403 ops/s
1,980,023 ops/s

Memory figures (B/op) from JMH gc.alloc.rate.norm profiler. All forks run with -XX:-StackTraceInThrowable to isolate algorithmic cost; exception-heavy libraries (iban4j, Garvelink) benefit from this flag on the rejection path — remove it for production-realistic numbers. Full methodology & raw data →

Balloon Burner

Fueled by Performance