ZATCA QR code generator and decoder

A ZATCA QR code is the code on a Saudi simplified tax invoice that holds the seller's name, VAT number, invoice time, invoice total and VAT total as Base64-encoded TLV (tag, length, value) data.

Encode the five Phase 1 ZATCA QR fields (seller, VAT number, time, total and VAT) as TLV Base64, or decode an invoice's QR text to check what it holds.

Built for
Browser-sideNo accountCopy, download, or print

Follows ZATCA's Electronic Invoice Security Features Implementation Standards, version 1.2 (19 May 2023), section 4.1. Reviewed 30 October 2026.

This makes the Phase 1 fields only (tags 1 to 5). A Phase 2 QR code also needs the invoice hash, signature and public key from a ZATCA-onboarded e-invoicing solution, and a PDF with this QR code on it is not a ZATCA e-invoice.

Last reviewed

Jump to result
Interactive workspace

Inputs

A sample number (15 digits starting and ending with 3). Replace it with your own.
Used only in Decode mode.

Result

More export options

ZATCA e-invoice QR (Phase 1, tags 1–5)
StatusReady to scan
TLV size68 bytes
QR text92 of 700 characters

Phase 2 (integration) e-invoices also need tags 6–9 from the device's ZATCA cryptographic stamp, so this QR alone is not a compliant Phase 2 invoice. It encodes the Phase 1 fields (tags 1–5).

ZATCA QR fields (tags 1–5, TLV)

TagFieldBytes (UTF-8)Value
1Seller name12Acme Trading
2Seller VAT registration number15300000000000003
3Invoice timestamp202026-10-30T10:00:00Z
4Invoice total (with VAT)6115.00
5VAT total515.00
AQxBY21lIFRyYWRpbmcCDzMwMDAwMDAwMDAwMDAwMwMUMjAyNi0xMC0zMFQxMDowMDowMFoEBjExNS4wMAUFMTUuMDA=

TLV bytes (hex): 01 0C 41 63 6D 65 20 54 72 61 64 69 6E 67 02 0F 33 30 30 30 30 30 30 30 30 30 30 30 30 30 33 03 14 32 30 32 36 2D 31 30 2D 33 30 54 31 30 3A 30 30 3A 30 30 5A 04 06 31 31 35 2E 30 30 05 05 31 35 2E 30 30

Examples

The five fields as TLV

Tag 1 seller name, tag 2 VAT number, tag 3 time stamp, tag 4 total with VAT, tag 5 VAT total. Each is written as one byte for the tag, one byte for the length and the value's UTF-8 bytes.

The sample invoice

Acme Trading, VAT number 300000000000003, 2026-10-30T10:00:00Z, total 115.00 and VAT 15.00 make 68 bytes, which encode as AQxBY21lIFRyYWRpbmcCDzMwMDAwMDAwMDAwMDAwMwMUMjAyNi0xMC0zMFQxMDowMDowMFoEBjExNS4wMAUFMTUuMDA=.

Arabic seller names

The length byte counts UTF-8 bytes, not characters. An Arabic letter takes two bytes, so a 10-letter Arabic name has a length of 20.

Decode to check a QR code

Paste the Base64 text read from an invoice's QR code and switch to Decode to see each tag and value, and whether Phase 2 tags 6 to 9 are present.

How to use it

  1. Choose Encode to make QR text, or Decode to read one.
  2. To encode: enter the seller's name, VAT number, invoice time stamp, invoice total with VAT and VAT total.
  3. To decode: paste the Base64 text from the QR code.
  4. Read the fields and the QR code, then download the SVG or copy the Base64.

Questions

What is in a ZATCA QR code?
For Phase 1: the seller's name, the seller's VAT registration number, the invoice time stamp, the invoice total including VAT and the VAT total, as tags 1 to 5. Phase 2 adds the XML invoice hash, the ECDSA signature, the public key and, for simplified invoices, the signature of the cryptographic stamp, as tags 6 to 9.
Can I use this for Phase 2 invoices?
Not to produce them. Tags 6 to 9 need the signed XML invoice and the cryptographic stamp that ZATCA issues to an onboarded e-invoicing solution, so a browser tool cannot create them. You can decode a Phase 2 QR code to read its tags.
Is an invoice PDF with this QR code ZATCA compliant?
No. A Saudi tax invoice must be generated by a compliant e-invoicing solution as structured XML. A PDF from a browser tool, even with a QR code, is not a ZATCA e-invoice.
What format should the time stamp have?
ISO 8601, such as 2026-10-30T10:00:00Z for UTC. Saudi invoices often use local time with +03:00 instead of Z.
Is there a size limit?
The Base64 text may be at most 700 characters, and each value at most 255 bytes, because its length is stored in a single byte.
Is my invoice data uploaded?
No. Encoding and decoding run entirely in your browser and nothing is uploaded. This tool does not keep a draft in your browser.

Sources

Last reviewed