---
title: "SWIFT / BIC Codes"
description: "Stop sending sensitive data to third-party APIs. Philterd ships open source PII and PHI redaction that runs inside your cloud. For HIPAA, GDPR, and CCPA work."
url: "https://philterd.ai/policies/finance/swift-bic-codes/"
---

[← All policies](https://philterd.ai/policies/)

Finance · Philterd

# SWIFT / BIC Codes

Redact SWIFT/BIC bank and business identifier codes (ISO 9362), validated structurally including a valid ISO 3166 country segment.

[View policy →](https://philterd.ai/policies/finance/swift-bic-codes/#policy-json) [Download JSON →](https://raw.githubusercontent.com/philterd/pii-redaction-policies/main/policies/philterd/finance/swift-bic-codes.json) [View source on GitHub](https://github.com/philterd/pii-redaction-policies/blob/main/policies/philterd/finance/swift-bic-codes.md)

**v1.0.0** Updated 2026-06-15 Philter `Requires Phileas 4.1.0+ (redaction policy schema 1.1.0 with the bic-structural validator)` By Philterd

SWIFT BIC ISO 9362 banking wire transfer

## The policy

The full `swift-bic-codes.json` file. The same content you’d get by downloading. Copy any part of it, or use the buttons in the hero to grab the whole file.

```
{
  "config": {
    "splitting": {
      "enabled": false,
      "threshold": 4000
    }
  },
  "ignored": [],
  "identifiers": {
    "identifiers": [
      {
        "classification": "swift-bic",
        "pattern": "\\b[A-Z]{4}[A-Z]{2}[A-Z0-9]{2}(?:[A-Z0-9]{3})?\\b",
        "caseSensitive": true,
        "validator": "bic-structural",
        "identifierFilterStrategies": [
          {
            "strategy": "REDACT",
            "redactionFormat": "[REDACTED-SWIFT-BIC]"
          }
        ]
      }
    ]
  }
}
```

## Example

Input

```
Send the wire to DEUTDEFF (or DEUTDEFF500 for the branch).
```

Output

```
Send the wire to [REDACTED-SWIFT-BIC] (or [REDACTED-SWIFT-BIC] for the branch).
```

## Entities this policy acts on

SWIFT\_BIC

## What this policy does

Detects and redacts SWIFT/BIC codes using Phileas’s generic `identifier` filter with the `bic-structural` validator. SWIFT/BIC has no checksum, so the validator checks the ISO 9362 structure (4 letters institution, 2 letters country, 2 alphanumeric location, optional 3 alphanumeric branch, for a length of 8 or 11) and requires the country segment to be a valid ISO 3166-1 alpha-2 code.

Matches are replaced with `[REDACTED-SWIFT-BIC]`.

## Why the validator matters

The BIC shape alone would match strings that merely look like a BIC. The validator keeps a match only if it is structurally valid with a real country code, so `DEUTZZFF` (a BIC shape with the unassigned country `ZZ`) is left in place while `DEUTDEFF` is redacted. A structurally valid code is not guaranteed to be an assigned BIC, so detection remains probabilistic; validate against your own documents.

## Test vectors

- Valid 8-character: `DEUTDEFF`, `BOFAUS3N`. Valid 11-character: `DEUTDEFF500`.
- Invalid 8-character (unassigned country `ZZ`): `DEUTZZFF`. Invalid 11-character: `DEUTZZFF500`.

## Contextual cues

In free text, anchor on a nearby cue (“SWIFT”, “BIC”) and capture only the code with `groupNumber`:

```json
{
  "classification": "swift-bic",
  "pattern": "(?:SWIFT|BIC)[\\s:#-]*([A-Z]{4}[A-Z]{2}[A-Z0-9]{2}(?:[A-Z0-9]{3})?)",
  "caseSensitive": true,
  "groupNumber": 1,
  "validator": "bic-structural",
  "identifierFilterStrategies": [
    { "strategy": "REDACT", "redactionFormat": "[REDACTED-SWIFT-BIC]" }
  ]
}
```

This trades recall for precision.

## Prerequisites

Use Phileas 4.1.0 or later, which provides redaction policy schema 1.1.0 and the `bic-structural` validator. The example input and output were verified against Phileas 4.1.0.

## References

- [ISO 9362 Business Identifier Code (SWIFT)](https://www.swift.com/standards/data-standards/bic-business-identifier-code)

## Use this policy

Download and load into your running Philter instance:

```
# Download the policy
curl -O https://raw.githubusercontent.com/philterd/pii-redaction-policies/main/policies/philterd/finance/swift-bic-codes.json

# Upload it to Philter as swift-bic-codes
curl -sk -X POST "https://localhost:8080/api/policies?name=swift-bic-codes" \
     -H "Authorization: Bearer $PHILTER_API_KEY" \
     -H "Content-Type: application/json" \
     --data @swift-bic-codes.json

# Redact text with it
curl -sk "https://localhost:8080/api/filter?p=swift-bic-codes" \
     -H "Authorization: Bearer $PHILTER_API_KEY" \
     -H "Content-Type: text/plain" \
     --data-binary "your text here"
```

For Philter 4.0. No Philter instance yet? The [quick start](https://philterd.ai/dev/start/) runs one and shows where `PHILTER_API_KEY` comes from · Want to tune this policy against your data? [Talk to the team](https://philterd.ai/policies/finance/swift-bic-codes/#).

[← All policies](https://philterd.ai/policies/)
