Verifactu QR code: size, position and content of the tax QR code

The Verifactu QR code (tax QR) is a QR code containing a Spanish Tax Agency (AEAT) URL, unique to each invoice, that lets the recipient check, if the invoice comes from a VERI*FACTU system, that it is on record at the AEAT. It must go at the start of the invoice, measure between 30 × 30 and 40 × 40 mm and, in the VERI*FACTU mode, come with the legend «VERI*FACTU» or «Factura verificable en la sede electrónica de la AEAT», under Order HAC/1177/2024.

What the Verifactu tax QR code is

It is an AEAT verification URL encoded in a QR, unique to each invoice. «Tax QR» (QR tributario) is the name the AEAT uses in its FAQ to tell it apart from any other QR on the invoice; the rules call it the «QR» code.

It is mandatory from the Verifactu dates: 1 January 2027 for Corporate Income Tax payers and 1 July 2027 for everyone else, according to the BOE, with a postponement to October 2028 announced but no rule published. More in When Verifactu comes into force.

Is the QR mandatory on every invoice?

Yes, on every invoice issued with an invoicing computer system subject to the RRSIF, full or simplified (receipts), and in both modes, according to the AEAT. The obligation is in arts. 6.5 and 7.5 of the Invoicing Regulation, introduced by RD 1007/2023. What changes with the mode is the legend: it only appears in VERI*FACTU.

It does not go on delivery notes, according to the AEAT. In a structured e-invoice the QR is not printed: its URL is included as a separate field (Order HAC/1177/2024, art. 20.2); in a PDF it goes as on paper.

Size of the Verifactu QR code

Verifactu QR code dimensions
MeasureValueSource
Minimum30 × 30 mmOrder HAC/1177/2024, art. 21.1
Maximum40 × 40 mmOrder HAC/1177/2024, art. 21.1
Code standardISO/IEC 18004Order HAC/1177/2024, art. 21.1
Error correctionLevel M (medium)Order HAC/1177/2024, art. 21.1
Quiet zoneAt least 4 modules (ISO/IEC 18004); the QR codes Verifacti generates use 6ISO/IEC 18004

Where the QR goes on the invoice

  • At the start of the invoice, before its content: it is the first QR on the invoice.
  • On a portrait invoice, at the top, near the top margin, preferably centred or, if not, near the top-left margin.
  • On a landscape invoice, on the left, preferably near the top-left margin.
  • Only once: if the invoice has several pages, on the first one.

Source: AEAT FAQ, which allows another position if there are obstacles, as long as the QR is clearly visible and distinguishable from any other code.

What the QR contains

The AEAT verification URL (https://www2.agenciatributaria.gob.es/wlpl/TIKE-CONT/ValidarQR in the VERI*FACTU mode) with four invoice parameters:

Parameters of the Verifactu QR URL
ParameterWhat it is
nifNIF of the invoice issuer
numserieInvoice series and number
fechaIssue date
importeInvoice total

The «VERI*FACTU» legend

In the VERI*FACTU mode, the invoice also carries the phrase «Factura verificable en la sede electrónica de la AEAT» or «VERI*FACTU», according to the AEAT, in a clearly visible font and size, similar to the rest of the invoice data (Order HAC/1177/2024, art. 20.1.b). In the NO VERI*FACTU mode the invoice carries the QR but not this legend. Differences in VERI*FACTU and NO VERI*FACTU modes.

How the recipient checks an invoice with a QR

They scan the QR with any device with a camera; the AEAT recommends its app. The AEAT website answers depending on the system that issued the invoice: Factura encontrada (invoice found: VERI*FACTU system, an identical invoice is on record), Factura no encontrada (invoice not found: VERI*FACTU system, not on record) or Factura no verificable (invoice not verifiable: NO VERI*FACTU system, which does not send records). To generate a test QR and see what it contains: Verifactu QR generator.

The QR, straight away with the Verifactu API

With the Verifactu API, the synchronous response to each invoice includes the QR in Base64 (PNG), ready to print next to the legend. The record is then sent to the AEAT.

How to add it to the invoice PDF: Verifactu in PHP.

Test environment and test NIF included

Questions about the Verifactu QR code

Is the QR mandatory on every invoice, receipts included?

Yes, on those issued with an invoicing system subject to Verifactu, simplified invoices included. What changes with the mode is the legend.

How does my customer check an invoice with a QR?

By scanning the QR: it opens the AEAT website. If the invoice comes from a VERI*FACTU system, the website shows whether it is on record; if it comes from a NO VERI*FACTU one, it answers «Factura no verificable» (not verifiable).

Does the QR always carry the VERI*FACTU legend?

No. The legend only appears in the VERI*FACTU mode. More in VERI*FACTU and NO VERI*FACTU modes.

How do I generate the Verifactu QR?

Your invoicing system generates it with the AEAT URL; with the Verifactu API you get it ready-made in Base64. To try one: Verifactu QR generator.

What size must the QR be?

Between 30 × 30 mm and 40 × 40 mm, under art. 21.1 of Order HAC/1177/2024.

Generate your invoices’ QR through an API

With the free account, send a test invoice and get its QR straight away.

Test environment and test NIF included