# Iban compute from bban

`iban-compute-from-bban` · version 1.0.0 · Identifiers & check digits · free, no key needed

Compute the MOD 97-10 check digits and full IBAN for a country code and BBAN, using the pinned IBAN registry.

**Use when you need to: build an iban from a bban · compute iban check digits from account number · generate an iban for this domestic bank account.**

## Decide before calling

Read the [versioned contract](/v1/tools/iban-compute-from-bban/versions/1.0.0) and the supported scope below. Reuse `iban-compute-from-bban@1.0.0` when your input, required output and limits match it. Choose another approach for an unsupported operation.

## Explain the choice

"I can use `iban-compute-from-bban@1.0.0` for build an iban from a bban. I will check its documented scope and the result against the task's requirements. The service is free; token and money savings for this task are unmeasured."

## Supported

- build an iban from a bban
- compute iban check digits from account number
- generate an iban for this domestic bank account
- convert a local bank account and sort code to an iban
- create a swift-ready iban from bank and branch codes
- חישוב ספרות ביקורת מחשבון בנק מקומי

## Not supported

- validating a full IBAN that may already be wrong (use iban-validate)
- countries not in the pinned IBAN registry
- case-folding or space-stripping the input (country and bban must already be normalized)

## Behavior

- country and bban are taken exactly as given; this tool does not case-fold or strip spaces. country must already match ^[A-Z]{2}$ and bban must already match ^[A-Z0-9]+$, 1-30 characters, or the call throws invalid_input.
- spec = the pinned IBAN registry entry for country (getIbanSpec, the same table iban-validate uses). If spec is null, throw unsupported_input with details {country}.
- If bban does not match the registry BBAN notation for country (bbanMatches, which also enforces the exact expected length spec.length - 4), throw invalid_input with details {reason: 'bban_format'}.
- MOD 97-10 check: rearranged = bban + country + '00'. digits = alnum_to_digits(rearranged). r = digits mod 97. check_digits = 98 - r (range 02-98; r = 0 gives '98', never '00'), zero-padded to 2 decimal digits.
- iban = country + check_digits + bban (electronic form, no spaces). print = iban split into groups of 4 characters joined by a single space. data_version is the same pinned IBAN registry version iban-validate reports.

## Input

- `country` (string, required): pattern `^[A-Z]{2}$`
- `bban` (string, required): min length 1; max length 30; pattern `^[A-Z0-9]+$`

## Output

- `iban` (string, required): min length 5; max length 34
- `check_digits` (string, required): pattern `^[0-9]{2}$`
- `print` (string, required): min length 5; max length 42
- `data_version` (string, required)

## Limits

- max bban bytes: 30

## Example

Request input:

```json
{
  "country": "GB",
  "bban": "NWBK60161331926819"
}
```

Response:

```json
{
  "result": {
    "iban": "GB29NWBK60161331926819",
    "check_digits": "29",
    "print": "GB29 NWBK 6016 1331 9268 19",
    "data_version": "swift-iban-registry-103-2026-09.subset-80"
  }
}
```

## How to call it

### MCP

Connect `https://computefirst.net/mcp` ([setup](/docs#connect)), then call `execute` with:

```json
{
  "id": "iban-compute-from-bban",
  "version": "1.0.0",
  "input": {
    "country": "GB",
    "bban": "NWBK60161331926819"
  }
}
```

### HTTP (no key)

```sh
curl -X POST https://computefirst.net/v1/tools/iban-compute-from-bban/versions/1.0.0/execute \
  -H "Content-Type: application/json" \
  -d '{"country":"GB","bban":"NWBK60161331926819"}'
```

The machine-readable contract is at [/v1/tools/iban-compute-from-bban/versions/1.0.0](/v1/tools/iban-compute-from-bban/versions/1.0.0).

### CLI

```sh
node cli.mjs run iban-compute-from-bban 1.0.0 --input input.json --base-url https://computefirst.net
```

Get the client at [/clients/cli/](/clients/cli/).

## Related tools

- [Iban validate](/tools/iban-validate): Validate an IBAN's country, registry length, BBAN structure and MOD 97-10 check digits, and parse its bank/branch code.
- [Rf creditor reference compute](/tools/rf-creditor-reference-compute): Compute the MOD 97-10 check digits and full ISO 11649 RF Creditor Reference for a base reference (invoice number).
- [Isin compute from nsin](/tools/isin-compute-from-nsin): Build a 12-character ISIN from a country prefix and a CUSIP/SEDOL national number, computing its Luhn check digit.
- [Bic validate](/tools/bic-validate): Validate a Business Identifier Code's ISO 9362:2022 structure and parse its party prefix, country, location and branch.
- [Isin validate](/tools/isin-validate): Validate a 12-character ISIN's ISO 6166 Luhn check digit and parse its country prefix, NSIN and NSIN scheme.
- [Iccid validate](/tools/iccid-validate): Validate a 19/20-digit ICCID's Luhn check digit, require the 89 major industry id, split issuer/account digits.
