How to Read a CFDI 4.0 Invoice XML: Fields, Taxes and Checks
A guide to reading Mexican CFDI 4.0 invoice XML files: issuer and receiver, items, IVA and withholdings, PUE and PPD, the UUID and how to check totals.

In Mexico an invoice is not a piece of paper or a PDF. It is an XML file called a CFDI, digitally signed by the issuer and stamped by an authorised provider. Many people receive these files and never open them, because raw XML is hard to read. This guide explains what is inside a CFDI 4.0 and how to read and check one with the free CFDI 4.0 Invoice XML Viewer.
Why the XML matters
The CFDI (Comprobante Fiscal Digital por Internet) is the legal invoice. The PDF that often comes with it is only a printed representation, and it can be wrong or even fake. If you deduct an expense, credit IVA or claim a refund, the tax authority looks at the XML. Version 4.0 has been required since 1 April 2023.
The header: who, when and how
The root element, the Comprobante, holds the general data:
- Serie and Folio: the issuer's own numbering.
- Fecha: the date and time of issue.
- TipoDeComprobante: I for income, E for credit note, T for transfer, N for payroll and P for payment.
- Moneda and TipoCambio: the currency and exchange rate if not pesos.
- FormaPago: how it was paid, using SAT codes such as 03 for transfer or 04 for credit card.
- MetodoPago: PUE when paid in one payment at issue, PPD when paid later or in parts.
- LugarExpedicion: the postal code where it was issued.
- SubTotal, Descuento and Total: the amounts.
Issuer and receiver
The Emisor element shows the issuer's RFC, name and tax regime. The Receptor shows your RFC, name, postal code, tax regime and the use of the invoice (UsoCFDI), for example G03 for general expenses or S01 for no tax effects. Version 4.0 made the receiver's exact name, postal code and regime mandatory, and they must match SAT's records.
Items and their taxes
Each Concepto describes one line: the product or service code from the SAT catalogue, quantity, unit, description, unit price, amount and discount. Under each item there are taxes: Traslados for taxes charged, usually IVA at 16%, and Retenciones for taxes withheld, such as ISR at 10% or IVA at two thirds of 16% when a company pays a professional.
At the end, an Impuestos block adds up the totals of taxes transferred and withheld.
The stamp
The TimbreFiscalDigital complement contains the UUID, a 36-character folio fiscal that identifies the invoice uniquely in SAT's records, and the date it was stamped. An XML without this stamp is not a valid invoice.
Payment receipts
For PPD invoices, when you receive payment the issuer must send a payment CFDI (type P) with the Pagos complement. It lists the date, amount and form of payment and the UUIDs of the invoices being paid. IVA on a PPD invoice can only be credited once that payment receipt exists.
How to use the viewer
- Click open and choose the XML file, or paste its text.
- Read the invoice header: folio, date, type, payment method and form.
- Check the issuer and receiver details against what you expected.
- Review each item with its codes, amounts, discount and taxes.
- Look at the checks panel. The viewer recalculates the subtotal from the items, the discount, and the total as subtotal minus discount plus taxes transferred minus taxes withheld.
- Print or save a readable copy for your records.
What the checks find
- A subtotal that does not match the sum of items.
- A total that does not add up.
- No stamp, meaning the file is a draft or was edited.
- An old version 3.3 file.
- A PPD invoice with a payment form other than 99, which SAT rules ask for.
Verifying with SAT
The viewer does not check the digital seal or whether the invoice was cancelled. To confirm, enter the UUID, the issuer and receiver RFC and the total in the SAT invoice verification service. Do this for large expenses before you deduct them.
Privacy
The file is read in your browser only. Nothing is uploaded, which matters because invoices contain names, RFCs and amounts.
Limits
This is a reading and arithmetic tool, not a tax opinion. Complex complements such as foreign trade or fuel may show only the core data.



