Home › Invoice QR generator

ZATCA QR code generator in TLV format

Enter the invoice details and get a QR code in the encoding ZATCA asks for, with each field broken down byte by byte. You can also paste the code from an invoice you have and see what is inside.

Make an invoice QR code

Everything runs in your browser. Nothing is sent anywhere.

Read an existing code

Who this is for

Developers building an invoicing system who want to check their encoding, and shop owners or accountants who want to understand what the printed code holds.

The generator makes the five base fields. A Phase 2 code adds signature fields that the invoicing system creates with its own private key, which no website can or should do for you.

How the code is built, step by step

  1. Each field starts with one byte holding the tag number (1 to 5).
  2. Then one byte with the value's length in UTF-8 bytes, not in characters.
  3. Then the value itself.
  4. The fields are joined in order and the whole buffer is converted to Base64.
  5. That Base64 text is what goes inside the QR code.

The five fields

TagFieldExample
1Seller nameRkeb Office Commercial
2Seller VAT number300089699700003
3Invoice date and time2026-10-26T09:15:00Z
4Invoice total incl. VAT57.50
5VAT amount7.50

Mistakes we see often

Phase 2: what gets added

In Phase 2 the invoicing system adds the invoice hash (tag 6), the digital signature (tag 7) and the public key (tag 8), and on a simplified invoice the certificate signature (tag 9).

These are made on the device that issued the invoice, with a key tied to its certificate from the Fatoora platform. Paste a Phase 2 code in the reader above and you will see them as Base64 bytes.

What to know about the invoice QR code

The code is open

The generator runs entirely in your browser and sends no data. The encoder is published under the MIT license at /js/zatca-tlv.js, and you can use it in your own system.

Sources: E-invoicing roll-out phases: ZATCA

Frequently asked questions

Can I use the code from here on a real invoice?

It uses the same encoding as ZATCA's five fields. A Phase 2 invoice also needs the signature fields made by an invoicing system connected to Fatoora, so use this for testing and learning.

Why is the Arabic name twice as long as its letters?

The length is counted in UTF-8 bytes, and an Arabic letter takes two.

Do you send the invoice data anywhere?

No. Everything is worked out in your browser.

How do I get the VAT from the total?

Multiply the total by 15 and divide by 115, or press the VAT button in the generator.

Related pages

First 500 restaurants, cafés, bakeries and sweet shops: a SAR 99 monthly cap.

Instead of SAR 149, per branch, for a full year. Free to join, no commitment.

Reserve your seat