Detectors
USt-IdNr
Detect and validate German VAT identification numbers with MOD 11,10 checksum.
Purpose
Use the ust_id detector for German VAT identification numbers (Umsatzsteuer-Identifikationsnummer).
Detector Name
ust_idSupported Formats
DEfollowed by 9 digits:DE136695976
The country prefix DE is required.
Validation Logic
- Strip spaces and uppercase the value.
- Must start with
DEfollowed by exactly 9 digits. - The first digit after
DEmust not be0. - Run the MOD 11,10 checksum on the 9 digits.
Checksum Algorithm (MOD 11,10)
Same as Steuer-ID checksum algorithm applied to the 9 numeric digits after the DE prefix.
- Start with a product of
10. - For each digit position 1-8:
- Add the digit to the product.
- Take
sum % 10. If0, replace with10. - Multiply by
2. - Take
product % 11.
- The 9th digit must equal
(11 - product) % 10.
Python Examples
Explicit Engine (Recommended)
from fastpii import FastPII
from fastpii.countries.de import GermanPack
priority = {"ust_id": 95, "steuer_id": 100, "email": 70, "name": 50}
engine = FastPII(priority=priority)
engine.register(GermanPack())
result = engine.detect("USt-IdNr: DE136695976", detector_names=["ust_id"])Convenience API
from fastpii import PrivacyGuard
guard = PrivacyGuard(regions=["de"])
result = guard.validate("DE136695976", "ust_id")
print(result.is_valid)Convenience API — Detect in free text
from fastpii import PrivacyGuard
guard = PrivacyGuard(regions=["de"])
result = guard.detect("USt-IdNr: DE136695976")
for finding in result.findings:
print(finding.type, finding.value)Limitations
- USt-IdNr is specific to German VAT identification.
- The
DEprefix is required for detection and validation. - Cross-border EU VAT verification is not performed.