A KSeF number is the unique number Poland's National e-Invoicing System (KSeF) gives an invoice when it accepts it. It always has 35 characters, is returned in the UPO receipt, and is not part of the invoice's XML file. It is not the invoice number the seller gives (field P_2): the two are different numbers (Ministry of Finance).
What does a KSeF number look like?
The pattern is 9999999999-RRRRMMDD-FFFFFFFFFFFF-FF (KSeF API documentation):
| Part | Characters | What it is |
|---|---|---|
9999999999 |
10 digits | the seller's NIP |
RRRRMMDD |
8 digits | the date KSeF accepted the invoice for processing |
FFFFFFFFFFFF |
12 | a technical part, hexadecimal: 0 to 9 and A to F, capitals |
FF |
2 | the check characters, a CRC-8 of the first 32 characters |
The ministry's example is 5265877635-20250826-0100001AF629-AF.
How is a KSeF number checked?
A number is valid when it has exactly 35 characters and its last two characters equal the CRC-8 of the first 32, computed with polynomial 0x07 and initial value 0x00 and written as two hexadecimal capitals (KSeF API documentation). The NIP inside it has its own check digit, so a typo there shows even before the CRC. Klarbon checks both on your device: check the KSeF numbers in your payment titles reads a bank statement and says, for a number that fails, which part is wrong.
Invoices from KSeF 1.0 carry 36 character numbers with one more hyphen in the technical part. The API still accepts them, and the documentation gives no check for that form.
Where is it used?
From 1 January 2027 an active VAT payer paying a structured invoice to another by transfer puts the KSeF number in the payment title; for several invoices in one transfer, a collective identifier instead. Since 1 February 2026 JPK_VAT records list it, and corrective and settlement invoices in FA(3) name the KSeF numbers of the invoices they refer to (Ministry of Finance).
Frequently asked questions
Is the KSeF number in the invoice's XML file?
No. KSeF assigns it after it accepts the invoice and returns it in the UPO, the official receipt. The XML the seller sends never holds it, so a viewer of the file alone cannot show it.
Is the KSeF number the same as the invoice number?
No. The invoice number, field P_2, is the seller's own numbering. The KSeF number is assigned by the system and identifies the invoice in KSeF.
Where is the KSeF number used?
In payment titles from 1 January 2027, in JPK_VAT records since 1 February 2026, on corrective invoices to point at the original, and on settlement invoices to point at advance invoices.
Sources
- Ministry of Finance, KSeF: Numer KSeF i zbiorczy identyfikator, version 2.2 (in Polish) ksef.podatki.gov.pl
- Ministry of Finance, KSeF 2.0 API documentation: Numer KSeF, structure and validation (in Polish) github.com
- Ministry of Finance, Elementy składowe numeru KSeF (PDF, in Polish) ksef.podatki.gov.pl