A client-side web application designed to generate ZATCA-compliant Phase 1 QR code Base64 strings. This tool simplifies the process of creating the required TLV (Tag-Length-Value) structure and encoding it into Base64 for E-Invoicing in Saudi Arabia.
- ZATCA Compliant: Strictly follows the Phase 1 specifications for QR code structure.
- Client-Side Only: All processing happens locally in your browser. No data is sent to any server, ensuring privacy and security.
- Instant Generation: Generates the Base64 string instantly as you input data.
- User-Friendly Interface: Clean, modern dark-mode design for ease of use.
- Copy to Clipboard: One-click button to copy the generated string.
- Open
index.htmlin any modern web browser. - Fill in the required fields:
- Seller Name: The name of the selling entity.
- VAT Registration Number: The 15-digit VAT number.
- Invoice Timestamp: Select the date and time from the picker. The app automatically formats it to the required ISO 8601 format.
- Invoice Total (with VAT): The total amount of the invoice including VAT.
- VAT Total: The total VAT amount.
- Click the Generate QR String button.
- The generated Base64 string will appear in the text box below.
- Click Copy to Clipboard to use the string in your E-Invoicing solution.
The application implements the ZATCA Phase 1 requirements using the following logic:
- TLV Encoding: Each of the 5 input fields is converted into a TLV (Tag-Length-Value) object.
- Tag: A 1-byte identifier (1 to 5).
- Length: A 1-byte indicator of the value's length in bytes.
- Value: The UTF-8 encoded byte array of the input string.
- Concatenation: The TLV byte arrays for all 5 fields are concatenated in order.
- Base64 Encoding: The final byte array is encoded into a Base64 string.
index.html: The main HTML structure.style.css: Styling and layout (Dark mode, Glassmorphism).script.js: Core logic for TLV encoding and DOM interaction.
This project is open-source and available for personal or commercial use.