When we talk about electronic invoice we come across two formats: XML and .p7m. There is often confusion. In this guide we clearly explain the difference between XML and .p7m invoices and how to open them.
The XML invoice
The XML format is the actual invoice: a structured file that contains all the data — supplier, customer, lines, taxable amount, VAT and total. It is the format defined by the Revenue Agency for the electronic invoice. On its own, however, the XML is not signed.
The .p7m file
The .p7m file is the same XML invoice, but enclosed in a digitally signed envelope (PKCS#7 / CAdES). The signature serves to guarantee authenticity and integrity and to give legal value to the document. The typical name is `IT01234567890_00001.xml.p7m`: first the XML, then the signature.
The difference in one sentence
- XML = the invoice (data).
- .p7m = the digitally signed XML invoice (the data + the signature).
In practice, the .p7m is the "sealed" XML: same content, but with the signature that makes it valid for the ES.
How to open both formats
With P7M Viewer open both .p7m and .xml files:
1. Open the Open .p7m tool.
2. Upload the .p7m file (or the XML directly).
3. View the invoice or download the extracted file.
If you start from a .p7m, you get the clean XML; if you want a readable copy, save it as PDF with "Print → Save as PDF".
When to use one or the other
- To send an invoice to the ES you need, when requested, the file signed .p7m.
- To read and archive the extracted XML (and maybe a PDF) is useful.
- The original with legal value remains the signed .p7m.
Frequently asked questions
Does .p7m contain XML? Yes, .p7m is XML plus digital signature.
Can I open an XML myself? Yes, with P7M Viewer you can also view .xml files.
Is it free? Yes, opening a single file is free.
In summary
The difference is simple: the XML is the invoice, the .p7m is the digitally signed invoice itself. With P7M Viewer open both formats in seconds, for free.