How to open and read an XRechnung XML file
By evoicely · Last checked 20 October 2026
An XRechnung is a pure XML file with no built-in layout, so a browser or text editor shows it as code. To read it as an invoice, open it in a viewer that renders the XML. The quickest way is to upload it to our free validator, which lays it out like a paper invoice and checks it against the official rules in the same step, without storing the file. KoSIT, which maintains the XRechnung standard, also publishes official stylesheets that turn an XRechnung into HTML or PDF. Or you can read the XML directly; the map below shows where everything is.
Why an XRechnung looks like code
XRechnung is Germany's version of the European e-invoice standard EN 16931. It exists only as structured data, written in one of two XML syntaxes: UBL (root element Invoice or CreditNote) or UN/CEFACT CII (root element CrossIndustryInvoice).
There is no PDF part. ZUGFeRD is different: it's a PDF with the XML embedded, so people can read the PDF and software reads the XML (XRechnung vs ZUGFeRD).
The XML file is the invoice. Any rendering of it, on screen or as a PDF, is a copy for reading. Keep the XML file you received or sent; see Germany's e-invoicing mandate.
Option 1: an online viewer
Open the validator, choose the XML file or paste its content, and click Check invoice. You get:
- The invoice, readable: seller and buyer with addresses, VAT IDs, electronic addresses and contact; number, dates, currency and type code; the buyer reference or Leitweg-ID and order reference; every line with quantity, price, VAT and service period; allowances and charges; the VAT breakdown and totals; bank details, payment terms and notes; and the names of any attachments.
- The verdict: whether the file passes the XML schema, the EN 16931 rules and the XRechnung rules, with each error explained.
Values are shown exactly as they are in the file, without recalculating anything, so what you see is what the buyer's software reads. It works for XRechnung in UBL and CII, ZUGFeRD / Factur-X (XML, or a PDF with the XML embedded) and Peppol BIS Billing 3.0. The file is processed in memory and never stored.
Need a copy to print or pass on? The result page has Download as readable PDF: the invoice as shown, with the check result. Our XRechnung viewer page walks through it.
Option 2: KoSIT's official visualization
KoSIT publishes the XRechnung visualization: XSLT stylesheets, under the Apache 2.0 licence, that render an XRechnung or EN 16931 invoice in UBL or CII as HTML or PDF.
It works in two steps: the invoice is first transformed into an intermediate XML that follows the XRechnung semantic model, and that is then turned into HTML (xrechnung-html.xsl) or PDF (xr-pdf.xsl).
You run it with an XSLT processor; the repository's README has the details, and releases are on its releases page and listed with the XRechnung bundles on xeinkauf.de.
This is the right choice if you want to build viewing into your own software, or need a PDF copy. The project itself notes that its output is for human reading and is not a valid XRechnung, so it doesn't replace the XML file.
Option 3: read the XML yourself
Any browser or text editor opens the file; most browsers show XML as a collapsible tree. Every value sits in an element with a fixed name, so once you know the names, you can find anything. This table shows where the main fields are, with values from a fictional example invoice:
| What | UBL | CII | Example |
|---|---|---|---|
| Format and version (BT-24) | cbc:CustomizationID | ram:GuidelineSpecifiedDocumentContextParameter/ram:ID | …kosit:xrechnung_3.0 |
| Invoice number (BT-1) | cbc:ID (top level) | rsm:ExchangedDocument/ram:ID | INV-2026-0001 |
| Issue date (BT-2) | cbc:IssueDate | ram:IssueDateTime | 2026-10-01 (UBL), 20261001 (CII) |
| Type (BT-3) | cbc:InvoiceTypeCode | rsm:ExchangedDocument/ram:TypeCode | 380 = invoice, 381 = credit note |
| Seller | cac:AccountingSupplierParty | ram:SellerTradeParty | Beispiel Software GmbH |
| Buyer | cac:AccountingCustomerParty | ram:BuyerTradeParty | Kunde Handels AG |
| Buyer reference / Leitweg-ID (BT-10) | cbc:BuyerReference | ram:BuyerReference | PO-4711 |
| Lines (BG-25) | cac:InvoiceLine | ram:IncludedSupplyChainTradeLineItem | Pro plan (monthly), 49.00 |
| VAT breakdown (BG-23) | cac:TaxTotal/cac:TaxSubtotal | ram:ApplicableHeaderTradeSettlement/ram:ApplicableTradeTax | 19% on 78.97 = 15.00 |
| Amount due (BT-115) | cac:LegalMonetaryTotal/cbc:PayableAmount | ram:DuePayableAmount | 93.97 |
| Due date (BT-9) | cbc:DueDate | ram:SpecifiedTradePaymentTerms/ram:DueDateDateTime | 2026-10-15 |
| Bank account (BT-84) | cac:PaymentMeans/cac:PayeeFinancialAccount/cbc:ID | ram:PayeePartyCreditorFinancialAccount/ram:IBANID | DE02 1203 0000 0000 2020 51 |
Here is the start of the same invoice in UBL. It was generated from fictional data by the same code evoicely uses, and the complete file passes the official KoSIT validator; the <!-- --> comments were added for this page.
<Invoice xmlns="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2" ...>
<cbc:CustomizationID>urn:cen.eu:en16931:2017#compliant#urn:xeinkauf.de:kosit:xrechnung_3.0</cbc:CustomizationID>
<cbc:ProfileID>urn:fdc:peppol.eu:2017:poacc:billing:01:1.0</cbc:ProfileID>
<cbc:ID>INV-2026-0001</cbc:ID> <!-- invoice number -->
<cbc:IssueDate>2026-10-01</cbc:IssueDate>
<cbc:DueDate>2026-10-15</cbc:DueDate>
<cbc:InvoiceTypeCode>380</cbc:InvoiceTypeCode> <!-- 380 = commercial invoice -->
<cbc:DocumentCurrencyCode>EUR</cbc:DocumentCurrencyCode>
<cbc:BuyerReference>PO-4711</cbc:BuyerReference>
<cac:InvoicePeriod> <!-- service period -->
<cbc:StartDate>2026-10-01</cbc:StartDate>
<cbc:EndDate>2026-10-31</cbc:EndDate>
</cac:InvoicePeriod>
<cac:AccountingSupplierParty> <!-- seller -->
<cac:Party>
<cbc:EndpointID schemeID="EM">billing@beispiel-software.example</cbc:EndpointID>
<cac:PostalAddress>
<cbc:StreetName>Musterstraße 1</cbc:StreetName>
<cbc:CityName>Berlin</cbc:CityName>
<cbc:PostalZone>10115</cbc:PostalZone>
...
<cac:InvoiceLine>
<cbc:ID>2</cbc:ID>
<cbc:InvoicedQuantity unitCode="C62">3</cbc:InvoicedQuantity> <!-- C62 = one (piece) -->
<cbc:LineExtensionAmount currencyID="EUR">29.97</cbc:LineExtensionAmount> <!-- net -->
<cac:Item>
<cbc:Name>Extra seats</cbc:Name>
<cac:ClassifiedTaxCategory>
<cbc:ID>S</cbc:ID> <!-- standard rate -->
<cbc:Percent>19</cbc:Percent>
...
<cac:Price>
<cbc:PriceAmount currencyID="EUR">9.99</cbc:PriceAmount>
</cac:Price>
</cac:InvoiceLine>
Things that trip people up
- Line amounts are net. VAT isn't added per line; it's in the VAT breakdown, one entry per VAT category and rate. The total with VAT is
cbc:TaxInclusiveAmount(UBL) orram:GrandTotalAmount(CII). - The amount due can be 0. If the invoice was already paid, for example by card, the paid amount (BT-113,
cbc:PrepaidAmountorram:TotalPrepaidAmount) is subtracted. - Codes instead of words. VAT categories:
Sstandard rate,Zzero rated,Eexempt,AEreverse charge,Kintra-EU supply. Payment means:58SEPA credit transfer,59SEPA direct debit,48bank card. - Dates in CII are written as
20261001withformat="102", which means YYYYMMDD. - Element order matters to software, not to you: if you edit a file by hand, validate it again.
Attachments inside the XML
An XRechnung can carry supporting documents, such as a timesheet, inside the XML (BG-24). In UBL they're in cac:AdditionalDocumentReference/cac:Attachment/cbc:EmbeddedDocumentBinaryObject, Base64-encoded, with a filename and mimeCode attribute.
EN 16931 allows PDF, PNG, JPEG, CSV, and Excel (XLSX) or OpenDocument spreadsheets (rule BR-CL-24).
A text editor shows them as a long block of characters. Our validator lists their names and types; to open one, decode the Base64 content into a file with that name, or use a tool that extracts attachments.
Got a PDF instead?
If the invoice is a PDF, it may be a ZUGFeRD or Factur-X file with the XML embedded. The validator extracts and checks the embedded XML too. If a PDF has no XML inside, it's a plain PDF invoice, not an e-invoice.
Related guides
- How to validate an XRechnung: the official KoSIT validator, step by step.
- Common XRechnung validation errors: what BR-DE-15 and the other rules mean.
- Mapping a Stripe invoice to EN 16931: the same fields from the sender's side.
- XRechnung vs ZUGFeRD.
Where evoicely fits
Open an XRechnung in the viewer, free and without signing up. If you send invoices from Stripe, evoicely turns them into XRechnung and ZUGFeRD, each checked with the official validators. Get started: it's free for 10 e-invoices a month.
This is general information, not legal or tax advice. Check what applies to your business with your tax advisor.