ZUGFeRD Invoice Example: XML Structure and Processing
TL;DR
- Understanding the hybrid format: A ZUGFeRD invoice consists of a PDF/A-3 file with embedded CII XML. Humans read the PDF, machines read the XML. This duality makes the format flexible for day-to-day B2B operations.
- Legal framework: Since 1 January 2025, businesses in Germany must be able to receive structured e-invoices. From 2027/2028, sending e-invoices will also be mandatory.
- XML example: This article presents an annotated XML example with the key structural elements (context, header, line items, parties and totals).
- Profile comparison: A table explains the six profiles (Minimum through Extended and XRechnung) and shows why only the higher profiles meet the legal requirements.
- Automated processing: NameQuick Invoices Web extracts XML data from ZUGFeRD invoices, enables review in the browser and exports results as DATEV EXTF or CSV.
Germany's e-invoicing mandate is driving the shift to digital invoicing: since 1 January 2025, businesses must be able to receive structured e-invoices electronically. From 2027 (for revenues exceeding 800,000 EUR) or 2028, the obligation to send e-invoices also takes effect. A plain PDF no longer suffices: an e-invoice is a structured data set that can be processed without manual effort. The European standard EN 16931 requires an XML-based format for this purpose.
Two formats are permitted in Germany: XRechnung (a pure XML document) and the ZUGFeRD format (from version 2.0.1), which embeds XML inside a PDF/A-3. This article uses a concrete example to show how a hybrid ZUGFeRD invoice is structured, explains the XML layout and describes how you can process the format automatically.
What Is a ZUGFeRD Invoice?
ZUGFeRD stands for "Zentraler User Guide des Forums elektronische Rechnung Deutschland" (Central User Guide of the Forum for Electronic Invoicing Germany). The format combines a visually readable PDF/A-3 invoice with an integrated XML file. The PDF component serves as a conventional invoice document for humans, while the XML represents the entire invoice content in the CII standard (Cross Industry Invoice). The PDF/A-3 standard (ISO 19005-3) allows the embedding of arbitrary files and guarantees long-term archival.
The hybrid approach is the key difference from XRechnung. XRechnung invoices are pure XML files without a visual representation and are used primarily in the public sector. The ZUGFeRD format combines PDF and XML; from version 2.2, it complies with the EN 16931 standard.
Important: public-sector contracting authorities in Germany do not currently accept the hybrid format as an e-invoice. For government agencies, an XRechnung (UBL XML) must be submitted. For the B2B sector, however, ZUGFeRD is widely adopted because suppliers can continue sending a PDF to their business partners.
Structure of a ZUGFeRD Invoice: PDF and XML
The hybrid format consists of two closely linked parts:
PDF/A-3 Container: The PDF follows the familiar layout of an invoice. It contains all fonts and color profiles and allows file embedding. Additional attachments (e.g. proof of delivery) can also be embedded.
XML File (factur-x.xml): The embedded XML file contains all invoice data in machine-readable form. When opening the PDF, the user sees the visual invoice; software extracts the XML and processes the structured data.
This dual-format concept provides both readability and automation: software extracts the XML data without OCR and reads fields such as invoice number, date and amounts with high accuracy. For more on digital invoice processing, see our guide.
Example: XML Structure of a ZUGFeRD Invoice
Below is a simplified XML example in the CII format. Comments explain the meaning of the tags.
<?xml version="1.0" encoding="utf-8"?>
<rsm:CrossIndustryInvoice
xmlns:rsm="urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100"
xmlns:ram="urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100"
xmlns:udt="urn:un:unece:uncefact:data:standard:UnqualifiedDataType:100">
<!-- Context: standard and profile (e.g. EN 16931, Factur-X) -->
<rsm:ExchangedDocumentContext>
<ram:GuidelineSpecifiedDocumentContextParameter>
<ram:ID>urn:cen.eu:en16931:2017#compliant#factur-x_2.2</ram:ID>
</ram:GuidelineSpecifiedDocumentContextParameter>
</rsm:ExchangedDocumentContext>
<!-- Document header: invoice number, type and date -->
<rsm:ExchangedDocument>
<ram:ID>471102</ram:ID> <!-- Invoice number -->
<ram:TypeCode>380</ram:TypeCode> <!-- 380 = Invoice -->
<ram:IssueDateTime>
<udt:DateTimeString format="102">20240115</udt:DateTimeString>
</ram:IssueDateTime>
</rsm:ExchangedDocument>
<!-- Trade details: line items, parties and totals -->
<rsm:SupplyChainTradeTransaction>
<!-- Invoice line item -->
<ram:IncludedSupplyChainTradeLineItem>
<ram:AssociatedDocumentLineDocument>
<ram:LineID>1</ram:LineID>
</ram:AssociatedDocumentLineDocument>
<ram:SpecifiedTradeProduct>
<ram:Name>Artikel A</ram:Name>
</ram:SpecifiedTradeProduct>
<ram:SpecifiedLineTradeAgreement>
<ram:NetPriceProductTradePrice>
<ram:ChargeAmount>100.00</ram:ChargeAmount>
</ram:NetPriceProductTradePrice>
</ram:SpecifiedLineTradeAgreement>
<ram:SpecifiedLineTradeDelivery>
<ram:BilledQuantity unitCode="H87">1.0000</ram:BilledQuantity>
</ram:SpecifiedLineTradeDelivery>
<ram:SpecifiedLineTradeSettlement>
<ram:SpecifiedTradeSettlementLineMonetarySummation>
<ram:LineTotalAmount>100.00</ram:LineTotalAmount>
</ram:SpecifiedTradeSettlementLineMonetarySummation>
</ram:SpecifiedLineTradeSettlement>
</ram:IncludedSupplyChainTradeLineItem>
<!-- Seller and buyer -->
<ram:ApplicableHeaderTradeAgreement>
<ram:SellerTradeParty>
<ram:Name>Lieferant GmbH</ram:Name>
</ram:SellerTradeParty>
<ram:BuyerTradeParty>
<ram:Name>Kunde AG</ram:Name>
</ram:BuyerTradeParty>
</ram:ApplicableHeaderTradeAgreement>
<!-- Payment information and grand total -->
<ram:ApplicableHeaderTradeSettlement>
<ram:InvoiceCurrencyCode>EUR</ram:InvoiceCurrencyCode>
<ram:GrandTotalAmount>119.00</ram:GrandTotalAmount>
</ram:ApplicableHeaderTradeSettlement>
</rsm:SupplyChainTradeTransaction>
</rsm:CrossIndustryInvoice>
The excerpt illustrates the structure: context (profile and standard), header (invoice number and date), line items (product, price, quantity) and payment information (currency and grand total). During import, software reads these fields and maps them to the business terms defined in EN 16931.
ZUGFeRD Profiles Compared
Not every ZUGFeRD invoice is EN-compliant. The format defines six profiles with varying levels of data depth. Only the profiles EN 16931 (Comfort), Extended and XRechnung meet the legal requirements of the e-invoicing mandate.
| Profile | Data Scope | EN 16931-Compliant | Typical Use |
|---|---|---|---|
| Minimum | Metadata only (invoice number, date). No line item or tax data. | No | Archival |
| Basic WL | Header + totals without individual line items. | No | Collective invoices, receipts |
| Basic | Full line items with prices and quantities. | No | Domestic invoices |
| EN 16931 (Comfort) | Complete EN 16931 data model including all required BT fields. | Yes | Standard for B2B and EU trade |
| Extended | Comfort + additional optional fields (e.g. proof of delivery). | Yes | Complex scenarios |
| XRechnung | Comfort data model with German CIUS rules; pure XML without PDF. | Yes | B2G invoices (government) |
For the e-invoicing mandate, you should select at least the Comfort profile. The Extended profile is suitable for extensive supplementary information, while XRechnung is mandatory for communication with government agencies.
Receiving and Processing ZUGFeRD Invoices
Why Automated Processing?
The e-invoicing mandate requires businesses to receive and retain electronic invoices. At the same time, manual import and data entry are error-prone and time-consuming. Modern invoice software uses OCR, artificial intelligence and XML parsing to extract invoice data automatically. Accurate capture facilitates posting in financial accounting and supports GoBD-compliant archival.
How NameQuick Invoices Web Works
NameQuick Invoices Web is a web-based solution for electronic invoice review. It runs entirely in the browser, is hosted in Germany and meets GoBD and DSGVO requirements. The workflow:
- Invoice intake: Upload invoices or forward them to a shared email address.
- Automatic recognition: The system detects the format and reads structured XML data from ZUGFeRD and XRechnung files with 99.9% accuracy. For PDF invoices without XML, OCR is used.
- Review: In a review queue, you check the extracted fields. Confidence scores flag uncertain values. Duplicates are detected automatically.
- Export: Export the reviewed data as CSV or in the DATEV EXTF format for your tax advisor. The original documents remain archived in an audit-proof manner.
Unlike complex DMS systems, no IT department is needed. Setup takes a few minutes. Plans from 9 EUR per month offer different quotas and export options. For more details on invoice intake software, see our comparison.
Invoice chaos in, DATEV-ready out
NameQuick Invoice extracts, reviews, and exports invoices for your accountant.
Creating vs. Receiving a ZUGFeRD Invoice
Many businesses ask: how do I create a ZUGFeRD invoice? Receiving works with automated tools, while creating requires generating a PDF/A-3 and a structured CII XML, embedding them together and validating the result. Specialized libraries and accounting software (e.g. Lexware, sevDesk or easybill) simplify these steps.
NameQuick Invoices Web covers only receipt and further processing. Creation is handled by other accounting programs. For invoices to public-sector contracting authorities, you should use the XRechnung profile directly, as the hybrid format is not accepted there.
Frequently Asked Questions
What is a ZUGFeRD invoice?
A ZUGFeRD invoice is a hybrid e-invoice in PDF/A-3 format with an embedded XML file. The XML contains all invoice data in the CII standard, while the PDF provides a human-readable document. From version 2.0.1, ZUGFeRD is EN 16931-compliant.
How do I send a ZUGFeRD invoice?
You need to create a PDF/A-3, generate a valid CII XML, embed it as factur-x.xml and validate the complete package. Send ZUGFeRD invoices by email. For B2G invoices, XRechnung is recommended.
Can I convert a PDF into a ZUGFeRD invoice?
Yes. You need software that converts your existing PDF into a PDF/A-3 and generates the invoice data as CII XML. A plain PDF without XML is not an e-invoice.
What is the difference between ZUGFeRD and XRechnung?
ZUGFeRD contains PDF and XML; XRechnung is XML only. Both formats are EN 16931-compliant and satisfy the e-invoicing mandate. ZUGFeRD is flexible for B2B, while XRechnung is required for the public sector.
Which ZUGFeRD profiles are permitted?
For the e-invoicing mandate, only the profiles EN 16931 (Comfort), Extended and XRechnung are accepted. Minimum and Basic profiles are not sufficient.
How does NameQuick Invoices Web read a ZUGFeRD invoice?
The software reads the XML directly from the embedded file, extracts all fields with 99.9% accuracy, assigns each value a confidence score and makes the data available for export. The PDF remains archived as a receipt.
What does it cost to process ZUGFeRD invoices?
NameQuick Invoices Web offers plans from 9 EUR per month (Starter: 50 invoices, CSV export). The Core plan (19 EUR/month) includes 200 invoices and DATEV EXTF export. For larger offices, there is the Team plan (39 EUR/month, 1,000 invoices).