Read and laid out in your browser
XML to PDF — as clean code, a table or a readable outline
Open or paste any XML: an invoice, a data export, a feed or a config file. Print it as indented, coloured code with line numbers, turn repeating records into a table, or read it as headings and values. If the XML is broken, the exact line and column are shown.
- Indented, coloured code
- Records as a table
- Errors with line and column
- Not uploaded to our server
Turn XML into a readable PDF
Choose or paste an XML file, pick how it should look on paper, and create the PDF.
Drop an XML file here
.xml and other XML files such as RSS, GPX, KML or .config, up to 20 MB
Or paste XML
Fix the line in a text editor, then choose the file again. You can still print the file as plain text with Code view.
Your XML
How it looks in the PDF
Your PDF is ready
You changed the settings after this PDF was made. Press Create PDF again to include the changes.
Pages in the PDF
Drawn from the saved file. Click a page to see it full size.
Next steps
More ways to work with structured files.
What this tool does
XML is for machines. This PDF is for people.
The same file can be printed three ways, depending on whether you need to check the code, read the records or understand the content.
What you get
- Code view: the XML re-indented with tags, attributes and values in colour, line numbers and wrapped long lines.
- Table: repeating records as rows, with attributes and child values as columns and the header repeated on every page.
- Outline: headings and name-value pairs that anyone can read.
- Broken XML named precisely: the line, the column and the reason, with the line shown.
- UTF-8, UTF-16 and older encodings such as ISO-8859-1 read from the XML declaration; Gujarati, Hindi and other scripts shown correctly.
- File name and page numbers on every page, A4, Letter or Legal, portrait or landscape, and a full-size check of every page.
What it can't do
- Run XSLT stylesheets. The data is shown, not a designed layout.
- Draw SVG files as pictures. An SVG is XML, so its code can be printed, but not the image.
- Fit any number of columns. Tables show up to 24; the rest stay in Code view.
- Open files over 20 MB or 100,000 lines. Split very large exports first.
How to turn XML into a PDF in three steps
Open, choose a view, create.
Open or paste the XML
Drop the file on the box, press Select an XML file, or paste XML into the box below it. The indented file appears with line numbers.
Choose how it looks
- Code view, Table, Outline or Pages.
- Page size, orientation and text size.
- Colours, line numbers, header and page numbers.
Create and check
Press Create PDF, open a page or two full size, then press Download PDF. Change the view and create again as often as you like.
Which view for your XML
Common XML files and the settings that print them best.
| Your XML | What you need | What to set |
|---|---|---|
| E-invoice or GST e-way bill XML | A copy someone can read and file | Outline for the header details; Table with One row per <item> for the lines. |
| Product, order or customer export | A printable list | Table, Landscape, 8 pt. |
| Config file (.config, pom.xml, .csproj) | A review copy with line numbers | Code view, colours and line numbers on. |
| RSS or Atom feed | The articles in a list | Table, One row per <item> or <entry>. |
| File made by PDF to XML | The pages back as a PDF | Pages, chosen automatically. |
| An XML that won't open anywhere | Find what's wrong | Open it here: the line and column of the error are shown. |
The details
How each view is built
What the tool does with your elements, attributes and text.
Code view
Your browser reads the XML into a tree, which is written out again with two spaces per level. An element holding only short text stays on one line. Comments, CDATA and the declaration are kept, and special characters are escaped so the printout is still valid XML.
Table
Elements that repeat under the same parent are offered as rows, the most frequent first. Each row's attributes and text-only children become columns; a child with its own children adds one column per value inside it. Repeated values in one row are joined with semicolons.
Outline
An element with children becomes a heading; one with only text becomes a name and its value. Attributes are listed under their element, marked with @. Deeper levels are indented, up to eight.
Errors
The browser's own XML parser checks the file. When it stops, its line and column are shown with the line itself and a marker. Common causes: a missing closing tag, an unescaped & or <, or a second root element.
Encodings and languages
The byte order mark or the encoding in the XML declaration decides how the file is read. When the text has letters the PDF's built-in fonts lack, pages are drawn as 180 dpi pictures; Print or save as PDF keeps real text instead.
Where your XML goes
Nowhere. The file is read and laid out in this tab with your browser's XML parser and pdf-lib. Start over, or closing the tab, clears it.
When the XML won't cooperate
What the message means, and what to do.
"Opening and ending tag mismatch"
A tag closes with a different name, or one was never closed.
Go to the line shown and match the closing tag to its opening tag.
"xmlParseEntityRef"
A bare & in text, often in a company name or URL.
Write it as &, or wrap the text in CDATA.
Table is greyed out
No element repeats under one parent, so there are no rows.
Use Outline, which suits single records.
Strange characters
The file's declared encoding doesn't match how it was saved.
The encoding used is in the line under the file name; re-save the file as UTF-8.
Columns too narrow
Many columns share one page width.
Choose Landscape and 7 or 8 pt, or Legal paper.
Cleaner printouts every time
Small choices that make the PDF easier to read.
Pick the view by the reader
Developers want Code view; accountants want Table; everyone else reads Outline best.
Landscape for wide tables
Automatic already turns tables with more than five columns; choose it yourself for long values.
Turn colours off for faxing
Plain black prints sharper on old printers and in black-and-white copies.
Keep line numbers for reviews
"Line 214" is quicker to point at than describing where something is.
Use 7 or 8 pt for exports
Smaller text fits more rows per page; the PDF stays sharp when zoomed.
Fix errors at the source
If an XML from a system won't parse, report the line and column to whoever produces it.
Common questions about XML to PDF
If something's not covered here, the sections above likely have it.
Which view should I choose?
Code view prints the XML itself, indented and coloured, with line numbers: best for checking or archiving a file. Table turns repeating records, such as invoice lines or a data export, into rows and columns. Outline shows each element as a heading or a name with its value, which reads well for configs and single records. Pages is for files made by our PDF to XML tool, one PDF page per <page> element.
My XML is all on one line. Will it be readable?
Yes. In Code view the file is re-indented from its structure, so each element starts on its own line with its nesting shown, and long lines wrap with a small indent. The line numbers are those of the indented version.
What happens if my XML has an error?
The page shows the line and column where the XML breaks, with the line itself and a marker under the spot, so you can fix it in a text editor. Until then, Code view still prints the file as it is written, with colours where tags can be recognised.
Can it make a table from my XML?
When an element repeats, such as <item> inside <items>, Table makes one row per element. Attributes and child values become columns, a header row repeats on every page, and wide tables turn the page to landscape automatically. Choose another repeating element under One row per.
Does it work with Gujarati, Hindi or other languages in the XML?
Yes. When the XML has letters the PDF's built-in fonts don't have, the pages are drawn as sharp pictures so every letter shows correctly; that text can't be selected. Print or save as PDF keeps it as real, selectable text in any language.
Does it apply XSLT stylesheets?
No. A stylesheet linked from the XML is not run. The views here show the data itself; if you need the exact layout an XSLT produces, open the XML in a program that runs it and print from there.
Is my XML uploaded to a server?
No. The file or pasted text is read, laid out and turned into a PDF in your browser, and it isn't uploaded to our server. Start over or closing the tab clears it from the page.