Skip to main content

Free tool · Saudi e-invoicing

ZATCA QR code generator and decoder

Enter seller, VAT number, timestamp, total and VAT to get the TLV Base64 string and a QR code, or paste a Base64 string to read tags 1 to 9. Everything runs in your browser.

Last updated:

Published:

Generate or decode a ZATCA QR code

In shortThe Encode tab builds the five ZATCA QR fields as TLV, converts them to Base64 and draws a downloadable QR image. The Decode tab reads any Base64 string and labels tags 1 to 9, showing signature and key tags as hex. It runs in your browser, so invoice data is never uploaded.

Everything runs in your browser. Nothing is uploaded or stored.

Arabic or English. Maximum 255 bytes in UTF-8. 0 of 255 bytes used.

Exactly 15 digits.

For example 2026-12-03T10:30:00Z.

Up to 2 decimals, for example 1150.00.

Up to 2 decimals, for example 1150.00.

Fill in all five fields correctly to generate the QR code.

This tab encodes tags 1 to 5 (seller, VAT number, timestamp, total, VAT). Phase 2 simplified invoices add tags 6 to 9, which come from signing the invoice; use the Decode tab to inspect them. Generating a QR code does not register, clear or report an invoice with ZATCA.

How the TLV Base64 string is built

In shortEach field is stored as three parts: a one-byte tag number, a one-byte length and the value in UTF-8. Tags 1 to 5 carry seller name, VAT number, timestamp, invoice total and VAT amount. The parts are joined and Base64-encoded. Because the length is one byte, no value can exceed 255 bytes.

ZATCA QR tags handled by the tool
TagFieldContentUsed in
1Seller nameUTF-8 text; Arabic names are normalPhase 1 and 2
2VAT registration number15 digitsPhase 1 and 2
3TimestampISO 8601 date and timePhase 1 and 2
4Invoice total including VATDecimal text, for example 1150.00Phase 1 and 2
5VAT amountDecimal text, for example 150.00Phase 1 and 2
6Invoice hashBinary, shown as hex by the decoderPhase 2
7ECDSA digital signatureBinary, shown as hexPhase 2
8Public keyBinary, shown as hexPhase 2
9Certificate signatureBinary, shown as hexPhase 2, simplified invoices

Worked example, byte by byte

In shortFor seller Sample, VAT number 300000000000003, timestamp 2026-12-03T10:30:00Z, total 1150.00 and VAT 150.00, the TLV data is 64 bytes: five two-byte headers plus 54 bytes of values. Base64 turns those 64 bytes into an 88-character string starting AQZTYW1wbGU. The generator produces exactly that output.

The value 300000000000003 is a dummy number for the example. Do not print sample data on real invoices. A name in Arabic works the same way, but each Arabic letter takes 2 bytes in UTF-8, so the length byte counts bytes, not characters.

TLV bytes in hex (tag, length, value)
01 06 53616d706c65                          tag 1, 6 bytes:  Sample
02 0f 333030303030303030303030303033        tag 2, 15 bytes: 300000000000003
03 14 323032362d31322d30335431303a33303a30305a  tag 3, 20 bytes: 2026-12-03T10:30:00Z
04 07 313135302e3030                        tag 4, 7 bytes:  1150.00
05 06 3135302e3030                          tag 5, 6 bytes:  150.00

AQZTYW1wbGUCDzMwMDAwMDAwMDAwMDAwMwMUMjAyNi0xMi0wM1QxMDozMDowMFoEBzExNTAuMDAFBjE1MC4wMA==

Common errors and what this tool does not do

In shortTypical failures are a VAT number that is not 15 digits, a seller name over 255 UTF-8 bytes, a timestamp that is not ISO 8601, and Base64 that was cut or edited. The tool only builds and reads QR text. It does not stamp, clear or report invoices, which needs ZATCA onboarding and a signing flow.

  • The VAT number is rejectedIt must be exactly 15 digits. Remove spaces and dashes and check for a missing digit.

  • The seller name is too longA tag value holds at most 255 bytes. Arabic letters take 2 bytes each, so a long Arabic trade name can hit the limit sooner than a Latin one.

  • The timestamp is wrongUse ISO 8601 with a T between date and time, for example 2026-12-03T10:30:00Z. The Use current time button fills it in.

  • Decode says a length is too largeThe Base64 text was probably cut, edited or double-encoded. TLV lengths are a single byte, so the declared length can never legitimately exceed 255.

When to use the desktop app instead

In shortA QR code made by hand suits testing and one-off documents. For daily invoicing, the RaqamBooks desktop app generates the ZATCA TLV Base64 QR code on each invoice, produces UBL 2.1 XML, archives issued documents locally and works offline. Clearance and reporting remain separate steps you complete with ZATCA.

The app prints the QR on bilingual PDF invoices and receipts, so staff never copy Base64 strings by hand. Read how invoices, credit notes and QR codes fit together on the invoicing feature page, see the Saudi rules on the Saudi Arabia page, or download the app and try it offline.

Frequently asked questions

What is a ZATCA QR code?

It is a QR code printed on Saudi e-invoices that holds the invoice's key facts as a Base64 string of TLV data. Phase 1 simplified invoices carry five fields: seller, VAT number, timestamp, total and VAT. Phase 2 adds signature-related tags.

Which fields does the QR code contain?

Tags 1 to 5 are seller name, VAT registration number, timestamp, invoice total including VAT and VAT amount. Phase 2 adds tags 6 to 9: invoice hash, ECDSA digital signature, public key and, for simplified invoices, the certificate signature.

Can the seller name be in Arabic?

Yes. Text tags are UTF-8, and Arabic seller names are normal. The 255-byte limit counts bytes, and an Arabic letter takes 2 bytes, so roughly 120 Arabic letters plus spaces fit. The tool shows the bytes used as you type.

Does this make my invoice ZATCA compliant?

No. The tool only encodes and decodes QR text. Compliance also depends on structured invoice formats, onboarding in the ZATCA Fatoora portal, cryptographic stamping and clearance or reporting, depending on your wave and invoice type. Confirm requirements with ZATCA.

Is my invoice data uploaded or stored?

No. The TLV bytes, Base64 string and QR image are all created in your browser. No request is sent with your seller, VAT number or amounts, and nothing is saved. Reloading the page clears every field.

No install needed

Download RaqamBooks and run your business offline

Install it on your own computer, keep your data local and avoid per-user monthly cloud fees. Early version for Windows 10/11 and macOS 13 or later (Apple chip and Intel chip).

Download for WindowsWindows 10/11 · 64-bit · choose your country edition
Download for macOSmacOS 13+ · Apple chip or Intel chip · choose your country edition
Try the demo (opens in a new tab)Runs in your browser · sample data

All downloads, checksums and install guideSee pricingTalk to us