KSeF QR code on an invoice: what it shows, when required
In short: a KSeF QR code is a link to the invoice in the Ministry of Finance (MF) system, saved as an image. You must put it on the invoice when you deliver the invoice outside KSeF (for example as a PDF to a consumer or a foreign company) or when you use the invoice outside the system (art. 106gb ust. 5 of the Polish VAT Act). An online invoice has one code with the KSeF number, while an offline invoice, before it is sent to KSeF, has two: "OFFLINE" and "CERTYFIKAT".
KSeF QR code: why it is on the invoice
In KSeF the invoice is the XML file in the system, not a PDF or a printout. The QR code connects the two: anyone with a printout or PDF scans the code with a phone and checks whether that invoice really is in KSeF and whether the data matches. After entering some extra data they can also download the invoice itself from KSeF (MF FAQ, category "Tryby offline i kody QR" (Offline modes and QR codes), q. 6).
The code is not needed when the invoice only moves within KSeF. A Polish company with a NIP (Polish tax number) receives it in the system and sees it there. No special reader is needed, a smartphone is enough (MF FAQ, category "KSeF w Jednostkach Samorządu Terytorialnego" (KSeF in local government units), q. 43).
When the QR code is mandatory
Art. 106gb ust. 5 of the VAT Act (ustawa o VAT; "art." is article, "ust." paragraph, "pkt" point) requires the invoice to be marked with a code in two situations:
- You make the invoice available outside KSeF to a buyer under art. 106gb ust. 4. That includes a consumer, a foreign company, an entity without a NIP, and a sale whose place of supply is another country.
- You use the invoice outside KSeF, for example you email a PDF to a Polish company in addition to KSeF, or print the invoice for the parcel.
An entity other than the seller has the same duty if it uses the invoice outside KSeF itself (art. 106gb ust. 5a). The MF sums it up briefly: the visualisation must have a QR code if the invoice is delivered outside KSeF, for example as a PDF (MF FAQ, category "Wystawianie i otrzymywanie faktur" (Issuing and receiving invoices), q. 34).
When a format cannot carry a code (for example EDI file exchange), a separate link or code image with the correct label can be sent along with the invoice (§ 9 ust. 8 of the regulation on using KSeF, rozporządzenie w sprawie korzystania z KSeF, Dz.U. 2025 poz. 1815).
CODE I and CODE II: how they differ
| CODE I (KOD I) | CODE II (KOD II) | |
|---|---|---|
| Purpose | verifying the invoice and accessing it in KSeF | confirming the issuer's identity |
| When it is on the invoice | always, when the invoice leaves KSeF | only an offline invoice handed over outside KSeF before it is sent to the system |
| Label under the code | the invoice's KSeF number, or "OFFLINE" if there is no number yet | "CERTYFIKAT" |
| What the link contains | seller's NIP, date of issue (P_1), SHA-256 hash of the invoice file | additionally the KSeF certificate identifier and context, signed with the certificate |
| What you need | nothing beyond the invoice file | a type 2 (Offline) KSeF certificate |
Source: MF page Kody weryfikujące QR (QR verification codes) and § 9 of the regulation Dz.U. 2025 poz. 1815.
A common mistake in guides: the Offline certificate does not "sign the invoice". The invoice XML file is not signed with it. The certificate signs the link in CODE II, so that after scanning, KSeF checks whether the certificate is valid and whether its owner may issue invoices for the seller (KSeF 2.0 documentation, QR codes). A different certificate (type 1) is used to log the software in to KSeF. You generate both in Aplikacja Podatnika KSeF (the free MF taxpayer app): see how to generate a KSeF certificate.
How many codes in which situation
- Online invoice delivered outside KSeF: one code, with the KSeF number under it (MF FAQ, category "Tryby offline i kody QR", q. 7).
- Offline24 invoice or one from a KSeF unavailability period, delivered outside KSeF before it is sent to the system: two codes, "OFFLINE" and "CERTYFIKAT" (same source, q. 8).
- The same offline invoice after the KSeF number is assigned: again one code with the KSeF number is enough (same source, q. 9).
Offline modes and sending deadlines in detail: KSeF offline24 mode.
How a customer checks the invoice with a phone
Access works in two steps (Podręcznik KSeF 2.0 (KSeF 2.0 manual), part II, chapter 5.5):
- Scanning. The buyer scans the code with the phone camera. A KSeF page opens (in production the address starts with qr.ksef.mf.gov.pl) with a message saying whether the invoice is in the system, plus basic data: KSeF number, seller's NIP, date of issue, date the number was assigned, mode (ONLINE or OFFLINE), and whether the document in KSeF matches the one the code was generated for. What each part of the KSeF number means is explained in KSeF number example and structure.
- Downloading the invoice. To download the invoice (XML or PDF) without logging in, you must enter: the invoice number given by the seller, the buyer's NIP or other identifier or a note that there is none, and the total amount due (§ 7 of the regulation Dz.U. 2025 poz. 1815).
After several wrong attempts in a row, downloading that invoice is temporarily blocked. If the invoice is not in KSeF, the page says so and the process ends there. That is a good warning sign with invoices from unknown suppliers.
Example: a PDF invoice from a store
A private customer asks for an invoice for an order of 211.99 zł. The store issues it voluntarily in KSeF (invoices for consumers do not have to go there, see KSeF invoice for consumers) and emails the PDF. The PDF must carry CODE I, with the invoice's KSeF number directly under it. The customer scans the code, sees "Faktura znajduje się w KSeF" (the invoice is in KSeF), and to download the original enters the invoice number, the note that there is no identifier, and the amount 211.99 zł.
If the store had issued this invoice in offline24 mode and sent the PDF before the invoice reached KSeF, the PDF would need two codes: CODE I labelled "OFFLINE" and CODE II labelled "CERTYFIKAT".
Our app KSeF Faktury (for Shopify) creates the PDF only after the KSeF number is assigned, so such a PDF has one code with the number. What the whole PDF looks like and what it must contain is covered in KSeF invoice visualisation (in Polish).
Frequently asked questions
Does every invoice need a QR code?
No. Only when the invoice is delivered or used outside KSeF. An invoice that a Polish company receives only in KSeF does not need a printout with a code.
Can I generate the QR code myself, without software?
The code is built according to the MF specification from the seller's NIP, the date of issue and the hash of the XML file. Invoicing software and the free MF tools do this when they create the invoice visualisation. Creating the code by hand makes no sense, because a single changed letter in the file gives a different hash.
What does "OFFLINE" under the code mean?
That the invoice does not have a KSeF number yet: it was issued in offline mode and is waiting to be sent or for the number to be assigned. After the number is assigned, one code with the KSeF number is enough on the visualisation.
Do I need a KSeF certificate for the QR code?
Not for CODE I. A type 2 (Offline) KSeF certificate is needed only for CODE II on offline invoices delivered outside KSeF before they are sent to the system (MF FAQ, category "Wystawianie i otrzymywanie faktur", q. 4).
This article is general information and not tax advice.
Sources
- Ustawa o podatku od towarów i usług (VAT Act), consolidated text Dz.U. 2026 poz. 1263: art. 106gb ust. 3-5a, art. 106nda ust. 6-8
- Rozporządzenie w sprawie korzystania z KSeF (regulation on using KSeF), Dz.U. 2025 poz. 1815: § 7 and § 9
- Kody weryfikujące QR (QR verification codes), ksef.podatki.gov.pl
- Pytania i odpowiedzi KSeF 2.0 (KSeF 2.0 Q&A), Ministry of Finance: category "Tryby offline i kody QR", q. 6-9; category "Wystawianie i otrzymywanie faktur", q. 4 and 34; category "KSeF w Jednostkach Samorządu Terytorialnego", q. 43
- Podręcznik KSeF 2.0, part II, chapters 5.4-5.6
- KSeF 2.0 documentation for integrators: QR verification codes (Ministry of Finance, GitHub)
Legal status as of 23 October 2026.