Skip to content
PDFinish

Convert XML to PDF

Add an XML file or paste your XML and get a PDF.

Drop area for your XML file

or drop it here. .xml files. XML files up to 50 MB

Your file stays on your device. Nothing is uploaded unless you choose Email it to me.

  • 2 free uses in total, no account needed
  • No ads
  • Nothing to install

How it works

  1. 1. Add your XML

    Choose a .xml file from your device, or paste your XML.

  2. 2. Choose how it looks

    Pick the indent, colors, font size, page size and direction.

  3. 3. Download your PDF

    Save the PDF. Long lines wrap onto as many pages as it needs.

What you can do in this tool

  • Indented one level at a time

    Tags are indented one level at a time, with tags, attributes and values in colors that still read in black and white.

  • Shown as written

    Text, entities and comments are shown as written.

  • Mistakes show the line

    If the XML has an error, you see the line first and can still print it as plain text.

  • Stays on your device

    Your XML is read and drawn in your browser. Nothing is uploaded, so settings, orders and feeds stay private.

  • Works on any device

    Runs in your browser on Windows, Mac, iPhone, Android or a Chromebook. Nothing to install.

Good to know

  • Your XML is read and drawn in your browser. Nothing is uploaded, so settings, orders and feeds stay private.
  • Your browser's own XML parser checks the file. It never loads external entities, DTDs or style sheets, and the tool fetches nothing from the web.
  • Tags are indented one level at a time, with tags, attributes and values in colors that still read on a black and white printer. Text, entities and comments are shown as written.

Common questions

How do I convert an XML file to PDF?

Add the .xml file, or paste your XML. Choose the layout, font size and page size, then press Convert to PDF. The tool checks the XML first and shows any error with its line. The PDF downloads from the result screen, and the work happens in your browser.

What happens if my XML is not valid?

The tool shows the line and column of the first problem and the browser's message, such as a tag that is not closed. You can fix it in the box and the check runs again. Or press Convert as plain text: the PDF prints your text as it is and shades the line with the problem.

Is XML with external entities or a DTD safe to open?

Yes. The check uses your browser's own XML parser, which does not load external entities, DTDs or style sheets, so a file cannot make the tool read other files or visit a web address. A reference to an outside entity stays unresolved and you see it as written.

Does it change my text, attributes or entities?

No. Names, attribute order, quotes, entities such as &, comments and CDATA are printed as written. With indenting on, only the spaces between tags change, and runs of spaces inside text become one space. Choose Keep my spacing if you need the layout exactly as it was.

Which characters and encodings work?

UTF-8, UTF-16 and older files that name another encoding, such as ISO-8859-1, are read. Latin, Greek and Cyrillic letters can be drawn. Chinese, Japanese, Korean, Arabic, Hebrew and emoji cannot yet, and we name the characters that are the problem instead of drawing empty boxes.

Is my file uploaded when I use XML to PDF?

No. Your XML is checked and saved as a PDF in your browser. The file is not sent to our servers.

Is XML to PDF free, and are there limits?

You can use it free. You get 2 free uses in total, no account needed. Free files can be up to 50 MB. Pro has no limit on uses and allows files up to 500 MB. We check the limits before a use starts, so a finished file is never held back.

Can I use XML to PDF on a Windows PC?

Yes. Open this page in Chrome or Edge on your PC, add your file and download the result. Nothing to install, and your file stays on your device.

More about this tool

How to convert XML to PDF in 3 steps

To convert XML to PDF, add your .xml file or paste the XML, choose the layout, font size and page size, and download the PDF. The XML is checked in your browser, so it is not uploaded or fetched from anywhere, and a mistake is shown with its line number.

  1. 1

    Add your XML

    Drop a .xml file onto the tool, or choose one from your device. You can also paste XML instead, and fix it in the box before you make the PDF.

  2. 2

    Choose how it looks

    Indent by 2 or 4 spaces, or keep your own spacing. Turn line numbers and colors on or off, pick a font size from 6 to 14 points, A4 or US Letter, and portrait or landscape.

  3. 3

    Download your PDF

    Save the finished file. Long lines wrap, and the text flows onto as many pages as it needs. If the XML has an error, you see the line first and can still print it as plain text.

The PDFinish XML to PDF tool with a sample XML file loaded, ready to convert to an indented PDF
A sample XML file loaded, ready to convert to an indented PDF.

How do I save an XML file as a PDF?

Add the file to XML to PDF, or paste the XML, then press Convert to PDF. You get an indented PDF with tags, attributes and values in different colors, and wide lines wrap to fit the page. The file is checked and drawn in your browser and is not sent to our servers.

How do I convert XML to PDF?

Open XML to PDF, add your .xml file or paste your XML, choose the indent, text size and page size, and press Convert to PDF. The PDF downloads straight away. Each finished conversion counts as one of your free uses, and the limit is checked before you start.

How do I pretty-print XML so it is easy to read?

Add the XML to XML to PDF and keep the indent at 2 spaces. Every tag goes on its own line, moved in one level for each level of nesting, so you can see what sits inside what. A short element with only text stays on one line.

Can I add line numbers to an XML PDF?

Yes. Tick Add line numbers and each line is numbered in the left margin of the PDF. A long line that wraps carries on below with no new number, so the numbers match the lines of the formatted XML. This helps when you discuss a file with someone and need to point to a spot.

Is it safe to convert XML to PDF online?

With XML to PDF, your file is checked and drawn inside your browser and is not sent to our servers. XML often holds private records, so this matters. You can confirm it in your browser's network tab, which shows no upload while you convert. The tool also fetches nothing the XML points to.

Can I convert XML to PDF for free?

Yes. You get 2 free uses in total with no account, and one finished conversion counts as one use. Free files can be up to 50 MB each. Pro has no limit on uses and allows files up to 500 MB. The limit is checked before you start.

Can I print an XML file with its colors on a black and white printer?

Yes. The colors are all dark enough to read on white paper, so a gray printout stays legible. Because the structure also comes from indentation and the tag brackets, the file is easy to follow without color. If you would rather print in plain black, untick Use syntax colors before you convert.

Can I convert XML to PDF on a Mac or a phone?

Yes. XML to PDF runs in the browser on a Mac, Windows, Linux, iPhone, iPad or Android device, so you need no extra software. On a phone, choose the file from your Files app or downloads folder, or paste the XML. Then download the PDF.

Can I keep several XML files in one PDF?

Convert each file on its own, then join the PDFs with Merge PDF, which also runs in your browser. Put them in the order you want first. You can then add page numbers with Add Page Numbers, which helps when you hand the file to someone.

What if my file is JSON, HTML or plain text instead?

Use the tool for that format: JSON to PDF for JSON, HTML to PDF for a web page, CSV to PDF for a table and TXT to PDF for plain text. XML to PDF is for XML, including feeds, sitemaps and exports.

Key facts

  • Privacy: We don't sell your data. This tool runs in your browser, so your files stay on your device and are never uploaded.
  • Ads: none. No third-party ads and no ad cookies.
  • Limits: 2 free uses in total, no account needed, and no limit on uses with Pro. Files up to 50 MB free, 500 MB with Pro. Limits are checked before a use starts, never after.
  • Price: free to start. Pro is $2.99 a month or $24 a year. Lifetime is $50 for the first 500 founders. Pro cancels in one click.
  • Works on: Windows, Mac, iPhone, Android. Nothing to install.
  • Your XML is read and drawn in your browser. Nothing is uploaded, so settings, orders and feeds stay private.
  • Your browser's own XML parser checks the file. It never loads external entities, DTDs or style sheets, and the tool fetches nothing from the web.
  • Tags are indented one level at a time, with tags, attributes and values in colors that still read on a black and white printer. Text, entities and comments are shown as written.

Last updated:

By the PDFinish editorial team · Reviewed