What the invoice QR code actually contains
The TLV structure behind ZATCA's QR code, what an inspector reads from it, why a mismatched total is worse than no code, and how India's IRP QR differs.
Updated 21 August 2026 · By Fatoza Technologies
The QR code on a Saudi e-invoice is not decoration and it is not a link. It carries the invoice’s key facts directly, so an inspector with a phone can read them without your system being online.
The structure
It is TLV — tag, length, value — then Base64 encoded. Each field is a numbered tag, a byte length, and the value:
| Tag | Field |
|---|---|
| 1 | Seller name |
| 2 | Seller VAT registration number |
| 3 | Invoice timestamp (ISO 8601) |
| 4 | Invoice total, including VAT |
| 5 | VAT amount |
Standard (B2B) invoices carry additional tags for the XML hash, the cryptographic stamp and the public key. Simplified invoices carry the five above.
Why a wrong code is worse than no code
If the QR says one total and the printed invoice says another, you have not failed to comply — you have produced a document that contradicts itself. That is a much more interesting finding for an auditor than a missing code.
This is the practical argument against building invoices in a spreadsheet with a QR add-in: the code is generated once and the cells keep changing. Any system where the code is regenerated from the invoice at print time avoids the whole class of problem.
India’s QR is a different thing
For Indian e-invoices, the QR code is a signed JWS returned by the Invoice Registration Portal along with the IRN. It is proof that the IRP registered the invoice, not a self-contained summary of it. Software that treats the two countries’ QR codes as the same feature will get one of them wrong.
Generating one correctly
Fatoza generates the code from the invoice at the moment of issue, so it cannot drift from the totals. If you just need a compliant-looking invoice today without changing your accounting system, the invoice maker is free and does the same encoding.
Frequently asked questions
Can I generate the QR code in Excel?
You can produce a QR image from any string. What you cannot reliably hand-build is a correct TLV structure, Base64 encoded, that stays consistent with the invoice as it is edited. A code that disagrees with the printed total is evidence against you, not a formality.
Is the Saudi QR code the same as the Indian one?
No. Saudi Arabia's is a TLV structure carrying seller and tax fields directly. India's is a signed JWS issued by the Invoice Registration Portal alongside the IRN. Different purposes, different contents, not interchangeable.
Related
People also search for
zatca qr code format · tlv base64 invoice qr · e invoice qr code requirements · irn signed qr code india · invoice qr code generator