XML to PDF converter

Turn an XML file into a PDF to read, print or attach to an email: pretty-printed, with tags, attributes and values in colour and every line numbered. Choose A4 or Letter and the text size, then download it. Everything runs in your browser

Page
Text

XML

PDF

This is an e-invoice: the e-invoice viewer lays it out as an invoice, with the seller, buyer, lines and totals, as a PDF
Some characters have no font here (Chinese, Korean, Arabic, Hebrew and others) and show as "?"
Paste or open a document, or load the example, then press Make PDF
lines

What the PDF looks like

  • The document is indented as the XML formatter does it, or kept as written with Pretty-print off.
  • Tags, attribute names, values and comments are coloured as in the editor, in a monospaced font, with a line number beside each line. A line too long for the page wraps under its indent, without a number.
  • Each page names the file and its page number. The text is real text: it can be searched and copied in any PDF reader.
  • Cyrillic, Greek, Vietnamese and Japanese are drawn with fonts embedded in the PDF. Characters no embedded font has, such as Chinese, Korean or Arabic, show as ? and the page says so.

Large documents

The PDF takes the first 80,000 lines, over 1,000 A4 pages at 8 pt, and says how many were left out. For a long file, a smaller text size or landscape pages put more on each page.

E-invoices

This page prints an e-invoice's XML as code. To get the invoice itself as a PDF, with the seller, buyer, lines and totals laid out as on paper, open it in the e-invoice viewer: it reads XRechnung, ZUGFeRD, Factur-X, Peppol, FatturaPA and KSeF. To check it before sending, use the validator.

Questions

Is my XML uploaded?

No. The PDF is made in your browser with pdf-lib; the file never leaves your machine.

Can I convert XML to PDF with an XSLT stylesheet?

Not here: this page prints the XML itself. XSL-FO needs a formatter such as Apache FOP. The XSLT transformer turns XML into HTML, which a browser can print to PDF.

Does the XML have to be well-formed?

Yes: a broken document stops with the line and column of the problem, so it can be fixed in the editor first. Untick Pretty-print to keep its own line breaks and indentation.

Can I search the text in the PDF?

Yes. The PDF holds the text, not a picture of it.

Other tools

  • XML formatter: Pretty-print or minify XML, keeping text, CDATA and comments as written.
  • XML viewer: Read a document as a tree you can fold, search and copy XPaths from.
  • XPath tester: Evaluate XPath 3.1 against a document and see each match with its line.
  • XSD generator: Infer an XML Schema from sample documents, checked against them.
  • XML from XSD: Generate a sample XML document from a schema, validated against it.
  • XSLT transformer: Run XSLT 1.0, 2.0 or 3.0 on a document and see the result, the messages and the files it writes.
  • XML diff: Compare two XML documents as trees: changed, added and removed elements, attributes and text.
  • XML to JSON converter: Convert XML to JSON, with arrays where an element repeats or wherever its XSD allows.
  • JSON to XML converter: Convert JSON to XML: @keys become attributes, arrays repeated elements.
  • XML to CSV converter: Turn a repeating element into CSV rows: invoice lines, products, records.
  • E-invoice viewer: Read an XRechnung, ZUGFeRD, Factur-X or Peppol invoice as a document, and save it as a PDF.
  • ZUGFeRD validator: Check a ZUGFeRD or Factur-X PDF: the XML inside against its profile's rules, and the PDF around it.
  • XRechnung validator: Check an XRechnung in UBL or CII against EN 16931 and KoSIT's XRechnung rules before you send it.
  • UBL validator: Check a UBL invoice, order or any other UBL 2.1 document against its OASIS schema, and the business rules of the profile it names.
  • Peppol validator: Check a Peppol BIS Billing 3.0 or PINT invoice against the OpenPeppol rules before your access point sends it.
  • P7M viewer: open a .p7m file: Open a signed .p7m file: the PDF, invoice or document inside it, and who signed it.
  • XRechnung examples to download: Example XRechnung and ZUGFeRD invoices to download, one for each common case.
  • E-invoicing mandate in Germany: do I have to?: Find out whether your invoices in Germany must be e-invoices in 2026, 2027 and from 2028.
  • Factur-X examples: Example Factur-X invoices of every profile and of the French reform, as XML and as PDF.
  • Leitweg-ID check: Check the form and the check digits of a Leitweg-ID, the address of a German public buyer.
  • Peppol lookup: Check whether a company is registered in Peppol, under which ID, and which invoices it can receive.
  • XML validator: check a document against XSD, DTD, RelaxNG or Schematron, up to 1 GB.