FastPII Docs
Detectors

Steuer-ID

Detect and validate German tax identification numbers with ISO 7064 MOD 11,10 checksum.

Purpose

Use the steuer_id detector for German tax identification numbers (Steuerliche Identifikationsnummer).

Detector Name

steuer_id

Supported Formats

  • 11 digits

German Steuer-ID always consists of exactly 11 digits.

Validation Logic

  1. Require exactly 11 digits.
  2. The first digit must not be 0.
  3. Run the ISO 7064 MOD 11,10 checksum.

Checksum Algorithm (ISO 7064 MOD 11,10)

  1. Start with a product of 10.
  2. For each digit position 1-10:
    • Add the digit to the product.
    • Take sum % 10. If 0, replace with 10.
    • Multiply by 2.
    • Take product % 11.
  3. The checksum digit (position 11) must equal (11 - product) % 10.

Python Examples

from fastpii import FastPII
from fastpii.countries.de import GermanPack

priority = {"steuer_id": 100, "email": 70, "name": 50, "phone": 20}
engine = FastPII(priority=priority)
engine.register(GermanPack())
result = engine.detect("Steuer-ID: 86095742719", detector_names=["steuer_id"])

Convenience API

from fastpii import PrivacyGuard

guard = PrivacyGuard(regions=["de"])
result = guard.validate("86095742719", "steuer_id")

print(result.is_valid)

Convenience API — Detect in free text

from fastpii import PrivacyGuard

guard = PrivacyGuard(regions=["de"])
result = guard.detect("Steuer-ID: 86095742719")

for finding in result.findings:
    print(finding.type, finding.value)

Limitations

  • Steuer-ID is specific to German tax identification.
  • The first digit must not be 0.
  • No digit may repeat more than 3 times consecutively (per official specification).

On this page