XML to PDF (with XSLT)

Turn XML into a PDF by applying an XSL or XSLT stylesheet in the browser, or print the XML as a readable tree or tidy source when there is no stylesheet.

Runs in your browser. Your files never leave your device. See how to check

…

How to do it

  1. 1
    Load the XML

    Drop one or more .xml files.

  2. 2
    Add a stylesheet

    Optionally choose the XSL or XSLT file.

  3. 3
    Choose the fallback

    Tree view or pretty-printed source.

  4. 4
    Paper and text

    Choose paper size, text size and page numbers.

  5. 5
    Check the result

    Read the preview and the report.

  6. 6
    Download

    Save the PDF.

About this tool

XML is everywhere behind the scenes: e-invoices, tax returns, bank statements, product feeds, configuration files and data exports. People who receive XML often need to read or print it, and many XML formats come with an XSLT stylesheet that turns them into a human-readable document. This converter applies that stylesheet in your browser and turns the result into a PDF with headings, paragraphs, lists and tables. When there is no stylesheet, it prints the XML as a clean indented tree of element names and values, or as tidy indented source code, which is far easier to read than one long line of tags.

With a stylesheet

Choose the XSL or XSLT file. The transformation runs with the browser's built-in XSLT 1.0 engine, and the HTML it produces becomes a PDF with headings, paragraphs, bulleted lists, tables and rules. Many e-invoice and government formats publish an XSLT "visualisation" for exactly this purpose.

If the XML names a stylesheet in its header, the report shows the name so you know which file to look for.

Without a stylesheet

- **Readable tree**: each element on its own line, indented by depth, with attributes in brackets and text values after a colon. - **Pretty-printed source**: the XML itself, indented, for developers and support staff.

Both use a monospaced font so indentation lines up.

Checking well-formedness

If the XML is broken, the report shows the parser's error message, which helps locate a missing closing tag or an invalid character.

Browser support

XSLT 1.0 is built into Firefox and, at present, Chromium browsers; some browsers are phasing it out. If yours does not run XSLT, the tool says so and you can still use the tree view.

Paper and size

Choose A4, Letter, A3, Tabloid or A5 and the text size; page numbers are optional.

Common XML documents

E-invoices (UBL, CII), tax and payroll submissions, bank statements in camt format, product feeds and sitemaps are all XML. For many of them, the publisher offers an official XSLT to display the content; using it gives a familiar layout.

Limits

XSLT 2.0 and 3.0 stylesheets are not supported by browsers. CSS styling, colours and images from the transformed HTML are simplified into a clean document layout. Very large XML files (tens of megabytes) may be slow in tree view. Nothing is uploaded, which matters for invoices and tax data.

Worked example

An e-invoice XML of 38 KB with its supplier's XSLT stylesheet becomes a 2-page PDF with the supplier and buyer blocks, an item table of 12 rows and totals; without the stylesheet, the tree view prints 214 indented lines.

Quick facts

Frequently asked questions

What is XSLT?

A language for transforming XML, often used to turn data files into readable documents.

Do I need a stylesheet?

No. Without one, the XML is printed as a readable tree or as tidy source.

Which XSLT versions work?

XSLT 1.0, which browsers support. Versions 2.0 and 3.0 are not supported.

What if my XML is broken?

The report shows the parser error so you can find and fix it.

Are images and colours kept?

The result is a clean document layout; styling and images from the HTML are simplified.

Is my XML uploaded?

No. Everything runs in your browser.

Guides for this tool

Completely freeNo cost, no sign-up
Files stay privateEverything runs in your browser
Easy in your languageAvailable in many languages