Polish KSeF ID Validator (e-Invoice)
Validate structural compliance, date, NIP and checksum of Polish KSeF identifiers.
About Polish KSeF Validation
Validation sanitizes input, accepts hyphenated or continuous formats, and verifies the embedded NIP via Modulo 11.
Ensures full compliance with the technical specifications of the Polish Ministry of Finance.
Anatomy & Structure of Polish KSeF Number
The KSeF identifier consists of 32 structured alphanumeric characters:
| Position | Field | Length | Meaning & Rule | Example |
|---|---|---|---|---|
| 1 to 10 | Issuer NIP | 10 digits | Tax Identification Number of the issuer verified via Modulo 11 | 1234567890 |
| 11 to 18 | Issue Date | 8 digits | Invoice date formatted as YYYYMMDD | 20260827 |
| 19 to 30 | Hex Technical ID | 12 hex | Two 6-character hexadecimal technical blocks | 1A2B3C4D5E6F |
| 31 to 32 | Hex Checksum | 2 hex | Internal hexadecimal check bytes of the KSeF system | A1 |
KSeF Assembly & Validation Algorithm
KSeF validation inspects the mathematical integrity of the 4 composite elements:
KSeF = NIP(10) + YYYYMMDD(8) + Hex(12) + Checksum(2)
- 1. Remove hyphens and validate the 32-character alphanumeric length.
- 2. Validate the embedded NIP in the first 10 digits using Modulo 11.
- 3. Validate the issue date in digits 11 to 18 ensuring valid day, month, and year.
- 4. Validate that the last 14 characters contain only hexadecimal digits (0-9, A-F).