Connect

Full-Screen Text View

0 matches

ZATCA Base64 & TLV Decoder

๐Ÿ“ Text & Base64 Inspector

Paste a Base64-encoded ZATCA QR code payload to instantly unpack binary Tag-Length-Value (TLV) fields and verify invoice parameters.

ZATCA Payload Text

Decoded Invoice Fields

Awaiting Input
Paste a ZATCA Base64 payload string on the left.
TagField NameValue
1Seller's Name-
2VAT Registration #-
3Invoice Timestamp-
4Invoice Total (with VAT)-
5VAT Total-
6Invoice Hash (Phase 2)-
7ECDSA Signature (Phase 2)-

Deconstructing ZATCA TLV Binary Payloads into Readable Tax Data

Under the hood, every Saudi ZATCA QR code contains a Base64-encoded string representing a binary Tag-Length-Value (TLV) structure. Software developers integrating POS or ERP systems with the Fatoora portal frequently need to inspect these raw strings.

This utility decodes the Base64 string into raw bytes, traverses the TLV tag boundaries, and maps every tag to its official ZATCA specification label, verifying length fields and UTF-8 string encoding.

How to Use

  1. Paste the Base64 string extracted from your invoice QR code into the input panel.
  2. The tool parses the TLV byte stream and validates the Tag and Length headers.
  3. View parsed fields: Seller Name, VAT Number, Timestamp, Total, VAT, and Phase 2 signatures.
  4. Copy individual fields or export the full parsed payload as formatted JSON.

Key Features & Capabilities

  • Traverses binary TLV bytes according to official ZATCA e-invoicing technical specifications.
  • Validates 15-digit VAT number structure and ISO 8601 timestamp formats.
  • Parses Phase 2 cryptographic fields: ECDSA signature, SHA-256 hash, and public key.
  • 100% private in-browser decoding with instant performance.

Common Developer Workflows

  • Unit testing ERP invoice generation engines before submitting to the ZATCA API.
  • Debugging barcode generation errors and invalid TLV length bytes.
  • Extracting VAT invoice metadata from database audit logs.
  • Verifying Phase 2 cryptographic stamp integrity.

Frequently Asked Questions

What is TLV format in ZATCA invoices?

TLV stands for Tag-Length-Value. Each data field starts with a 1-byte Tag number, followed by a 1-byte Length indicating the size of the data, followed by the Value bytes.

Why does my ZATCA Base64 string fail to decode?

Common reasons include trailing whitespace, missing Base64 padding, or incorrect character encoding (ZATCA mandates UTF-8 for text fields).

Does this tool support Arabic seller names?

Yes! Arabic text encoded as UTF-8 in Tag 1 is fully decoded and displayed accurately.