ZATCA E-Invoice QR Code Generator và Decoder (TLV, Base64)
Tạo mã QR ZATCA từ năm trường hóa đơn, hoặc dán hoặc quét một mã để giải mã và kiểm tra nó, từng lần hoặc theo lô.
Chạy trong trình duyệt của bạn. Tệp không bao giờ rời khỏi thiết bị. Xem cách tự kiểm tra
…
Cách thực hiện
- 1Chọn chế độ
Chọn tạo, giải mã hoặc lô.
- 2Nhập vào các trường
Trong chế độ tạo, nhập năm trường hoặc sử dụng nút 15% cho VAT.
- 3Đăng hoặc quét
Trong chế độ giải mã, dán base64 hoặc tải ảnh của QR.
- 4Kiểm tra các vấn đề
Đọc cảnh báo và bảng ghi.
- 5Làm việc theo lô
Đăng nhiều dòng và tải xuống kết quả dưới dạng CSV.
- 6Xuất khẩu QR
Sao chép base64 hoặc tải QR dưới dạng SVG hoặc PNG.
Giới thiệu công cụ này
Every Saudi e-invoice carries a QR code. In the format set by ZATCA, the code holds a series of tag-length-value records: tag 1 is the seller name, tag 2 the VAT registration number, tag 3 the time stamp, tag 4 the invoice total with VAT and tag 5 the VAT total, each stored as UTF-8 text after a tag byte and a length byte. The bytes are then encoded as base64, and that text is what the QR shows. This tool does the job in both directions: it creates the base64 and the QR image from the fields, and it decodes a pasted code or a photo of a QR, lists the records and checks them for common mistakes.
Who this is for
Developers who build or test invoice systems, accountants who review invoices from suppliers, shop owners who want to know what their point-of-sale prints, and auditors who check a batch of receipts.
Creating a code
Type the seller name, which can be Arabic, the VAT number, the date and time and the two totals. The tool writes the time of supply as an ISO 8601 date and time, such as 2026-10-28T14:30:00, and the QR updates as you type. A button fills in the VAT from the total at 15 percent. You can copy the base64 or download the QR as SVG or PNG to place it on a document.
Decoding and checking
Paste the base64 text, or load a photo or screenshot of the QR and the tool reads it in your browser. The table lists every tag, its meaning, its length in bytes and its value. The checks look for missing tags, a VAT number that is not 15 digits starting and ending with 3, a time stamp that is not a valid date, totals that are not numbers and a VAT total larger than the invoice total. Codes from phase 2 invoices also contain tags 6 to 9, the hash, the signature, the public key and ZATCA's stamp, which the tool shows in short form.
Batch mode
Paste many lines at once. A line with five comma-separated values, in the order seller, VAT number, time, total and VAT, is encoded. A line with a long base64 text is decoded. The results table shows each line's status, and you can show any code as a QR, copy all the codes or download a CSV for a spreadsheet.
Why the length is in bytes
Arabic letters take two bytes each in UTF-8, so a seller name of 10 Arabic letters has a length of 20. A common bug in home-made systems is to write the number of characters instead of bytes, which breaks the code for Arabic names. The decoder shows the byte length so you can spot it.
What this does not do
The tool cannot create the cryptographic stamp of phase 2, which only a certified e-invoicing solution connected to ZATCA can produce, and it does not tell you whether an invoice was reported to ZATCA. It checks the format only.
Worked example
Seller "Example Trading Est.", VAT number 310122393500003, time 2026-10-28T14:30:00, total 1150.00 and VAT 150.00 give a base64 code of about 120 characters. Decoding it lists the five tags with lengths of 20, 15, 19, 7 and 6 bytes.
Limits
A format helper only, not an official ZATCA validator or tax advice.
Ví dụ có lời giải
Một mã với năm thẻ giai đoạn 1 cho hóa đơn 1.150 riyal với 150 riyal VAT giải mã đến các thẻ 20, 15, 19, 7 và 6 byte.
Tóm tắt
- Danh mục: Lập trình và dữ liệu
- Chạy trong trình duyệt, không đăng ký, không tải lên.
- Thông tin bạn nhập ở lại trên thiết bị.
- Có bằng tiếng Anh.
- Nội dung được rà soát lần cuối:
- Nguồn chính thức: ZATCA, e-invoicing QR code specification (TLV, base64)
Câu hỏi thường gặp
ZATCA QR sử dụng định dạng nào?
Các bản ghi giá trị chiều dài thẻ trong UTF-8, được mã hóa là base64.
Những trường nào trong mã giai đoạn 1?
Tên của người bán, số VAT, con dấu thời gian, tổng cộng với VAT và tổng VAT.
Tôi có thể giải mã một QR từ ảnh không?
Đúng vậy, bạn tải một hình ảnh và công cụ đọc mã trong trình duyệt của mình.
Tại sao tên người bán bằng tiếng Ả Rập của tôi lại phá mã?
Chiều dài phải bằng byte, và các chữ cái tiếng Ả Rập sử dụng hai byte mỗi trong UTF-8.
Nó có thể tạo ra mã giai đoạn 2 không?
Không, con tem mật mã cần một giải pháp hóa đơn điện tử được chứng nhận.
Có gì được tải lên không?
Không, mã hóa, giải mã và đọc hình ảnh đều diễn ra trong trình duyệt của bạn.
