What a ZATCA Phase 1 QR code holds
Saudi Arabia's Zakat, Tax and Customs Authority (ZATCA) requires a QR code on simplified tax invoices under its e-invoicing (FATOORA) rules. In the first phase, called the generation phase, the QR code carries five fields. ZATCA describes the format in its published "Guide to Developed FATOORA Compliant QR Code", and this tool follows that guide. Its tests reproduce the guide's worked example byte for byte.
The five values are turned into bytes, packed as TLV (tag, length, value), and the whole byte array is written as Base64 text. That Base64 text is what goes into the QR code. For the guide's example seller, Bobs Records, the output is:
AQxCb2JzIFJlY29yZHMCDzMxMDEyMjM5MzUwMDAwMwMUMjAyMi0wNC0yNVQxNTozMDowMFoEBzEwMDAuMDAFBjE1MC4wMA==
Field by field
Each field is one tag byte, one length byte, then the value as UTF-8 bytes. There is no padding between fields.
| Tag | Field | What the tool checks and writes |
|---|---|---|
| 1 | Seller name | Required, at most 255 bytes in UTF-8 |
| 2 | VAT registration number | Exactly 15 digits, the first and last digit 3 (rule BR-KSA-40 of the ZATCA XML implementation standard) |
| 3 | Invoice date and time | Entered in Saudi time, written in UTC as YYYY-MM-DDTHH:MM:SSZ |
| 4 | Invoice total with VAT | Up to 12 digits before the decimal point, always written with two decimals |
| 5 | VAT total | Same format, and it cannot be larger than the invoice total |
Why lengths are counted in bytes
The length is a single byte, so no value can exceed 255 bytes. UTF-8 uses one byte for a Latin letter or a digit and two bytes for an Arabic letter. The tool counts bytes, not characters, so an Arabic name that looks short on screen is still measured correctly. With these limits the longest possible output is 440 Base64 characters, inside the 500 character limit the guide sets.
Amounts
Amounts accept a point or a comma as the decimal sign and at most two decimals. 1000 becomes 1000.00 and 99.5 becomes 99.50. The tool compares total and VAT as whole halalas, without floating point rounding.
How a scanner reads it
A reader decodes the QR code to the Base64 text, decodes the Base64 to bytes, then walks the bytes: read a tag, read a length, take that many bytes as UTF-8 text, repeat. A buyer or an auditor can compare the five values with the printed invoice. The tool decodes its own QR image and confirms it reads back as the exact Base64 text. Link2QR has not tested these codes with ZATCA tools or third-party scanner apps, so scan the result and check every field before use.
What this tool does not do
- It does not write tags 6 to 9, the Phase 2 invoice hash, signature, public key and certificate signature.
- It does not connect to ZATCA, report invoices, or request clearance.
- It does not create or store the invoice itself. It only produces the QR content for values you type.
- It does not calculate VAT for you. Enter the totals exactly as they appear on the invoice.
Common mistakes
- Entering the total before VAT in the total field. Tag 4 is the total including VAT.
- Entering the time in UTC when the form expects Saudi time, which shifts it by three hours.
- Typing the commercial registration number instead of the 15-digit VAT registration number.
- Using a seller name that differs from the one printed on the invoice.
Frequently Asked Questions
Is a QR code from this page enough for Phase 2?
No. Phase 2 (the integration phase) adds tags 6 to 9: the invoice hash, an ECDSA signature, the public key and the certificate signature. They need a cryptographic stamp issued through ZATCA onboarding of your invoicing system. This page writes only tags 1 to 5.
Does this QR code make my invoice compliant?
No. A QR code is one element of an invoice. The invoice itself, its contents and the system that produces it all have their own requirements. Use this tool to produce or check the Phase 1 QR content, and follow ZATCA's own guidance for everything else.
Why is the time stored in UTC?
The worked examples in ZATCA's QR code guide show the time stamp in UTC with a trailing Z. Saudi Arabia uses UTC+3 with no daylight saving, so the tool subtracts three hours from the time you enter. An invoice issued at 18:30 Saudi time is stored as 15:30:00Z.
Can I use an Arabic seller name?
Yes. The name is stored as UTF-8. Each value can be at most 255 bytes because its length is stored in one byte, and an Arabic letter takes 2 bytes, so an all-Arabic name fits about 127 letters.
Is my invoice data sent anywhere?
No. The TLV bytes, the Base64 text and the QR image are all built in your browser.