Skip to main content

Microtec

ZATCA QR Code Generator for Tax Invoices

Five fields → TLV encoding → Base64 text → phase 1 QR code.

This is a phase 1 code only, and it does not turn any document into an e-invoice under ZATCA's rules. The phase 2 (integration) code adds the invoice hash, a digital signature and the public key, and only a compliant e-invoicing solution connected to ZATCA can produce it.

SAR
SAR

Everything is worked out in your browser; no field is sent to a server.

—

—

Date
—
VAT
—
Total
—
Fill in all five fields to see the code

Phase 1 QR code

TLV breakdown, field by field
TagFieldLength (bytes)ValueFirst bytes (hex)
—

The ZATCA QR code generator above builds the code that phase 1 of e-invoicing in Saudi Arabia puts on a simplified tax invoice. It carries five fields: the seller name, the seller VAT number, the invoice date and time, the total including VAT and the VAT amount. Enter them and the code appears on a sample receipt, together with the Base64 text it holds and a table that breaks the fields down tag by tag. Use it to check a code your own system prints, or to see what ZATCA's app reads when it scans your invoice.

Short answerEach field is written in three parts: the tag number, the length of the value in bytes, then the value. The five fields are joined end to end and converted to Base64, and that text is what gets drawn as the QR code.

How a ZATCA QR code is built with TLV encoding

TLV (Tag-Length-Value) puts two bytes in front of every value: the tag number from 1 to 5, then the length of the value in bytes after UTF-8 encoding. Latin letters and digits take one byte each, while each Arabic letter takes two, so a seller name written in Arabic comes out at about twice its character count. Once the five fields are joined, the whole byte string is converted to Base64.

[Tag 1 byte][Length 1 byte][Value UTF-8] × 5 → Base64 → QR

Example: "Al Rayan Trading Est." with VAT number 310122393500003, and an invoice dated 1 October 2026 at 12:30 Saudi time for a total of SAR 1,150.00 with VAT of SAR 150.00. The seller name is 21 characters, all Latin, so it is 21 bytes and the first field starts with the bytes 01 15 (hex 15 is 21). The date is written in UTC as 2026-10-01T09:30:00Z, which is 20 bytes. The resulting text starts with ARVBbCBS, and the Example button loads it.

E-invoice QR code in phase 1 and phase 2

In phase 1 (generation) a simplified tax invoice carries a code with the five fields, according to the ZATCA FAQ. In phase 2 (integration) the code grows to nine tags, as the e-invoicing detailed guideline sets out: the first five, plus the invoice hash, the digital signature, the public key and the signature of the stamp certificate. Those four extra tags cannot be typed by hand; they come from an e-invoicing solution that holds a certificate from ZATCA. That is why this generator deliberately stops at phase 1.

What ZATCA's app reads when it scans the code

The authority used to be called GAZT (the General Authority of Zakat and Tax) and is now the Zakat, Tax and Customs Authority; the code itself did not change with the name. When a buyer scans it with ZATCA's app or any QR reader, the app decodes the Base64 text and shows the five fields. Seeing those fields does not mean the invoice is registered with ZATCA, since anyone can generate them; real verification in phase 2 relies on the digital signature.

Common mistakes in an invoice QR code

  • Writing the field length as a character count instead of a byte count, so an Arabic seller name is read cut short.
  • A VAT number with 14 digits or with spaces; the correct format is 15 digits starting and ending with 3.
  • The total before VAT in field 4, where the total including VAT belongs.
  • A date with no time, or in local time with no time zone offset.
  • Drawing a link to an invoice page into the code instead of the Base64 text.

What to do after you generate the code

Download the code as a PNG to drop into a document, or as an SVG if you want to print it large without it blurring. If you are checking a code your own system prints, copy the Base64 text from the generator and compare it with the text your system produces for the same invoice: any difference means one of the fields is written another way.

When you need a phase 2 code

A business whose integration wave comes due needs invoices that leave a compliant solution, signed and sent to the FATOORA platform; a hand-generated code is not enough. At Microtec we offer accounting software (ERP) that brings sales, purchasing, inventory and finance together, and our solutions are approved by the Zakat, Tax and Customs Authority. Try it before your wave comes due.

Frequently asked questions

What data does a ZATCA invoice QR code hold?

In phase 1, five fields: the seller name, the seller VAT number, the invoice date and time, the total including VAT and the VAT amount, encoded as TLV and then Base64.

Does this code make my invoice an e-invoice?

No. An e-invoice comes out of a compliant e-invoicing solution, and the code alone does not change what the document is. The phase 2 code needs a digital signature that only a solution connected to ZATCA can generate.

Why does the field length differ from the number of characters in the seller name?

Because the length is counted in bytes after UTF-8 encoding, and an Arabic letter takes two bytes. "Al Rayan Trading Est." is 21 Latin characters and 21 bytes; the same name in Arabic letters comes to 40 bytes for 21 characters.

What date format goes into the QR code?

ISO 8601 in UTC, such as 2026-10-01T09:30:00Z. The generator takes the time in Saudi time and subtracts three hours.

↑