DO IT EASY APP
English

PDF to XML

Turn a PDF's text into an XML file with page and paragraph structure. Optionally include the position of each line.

  • No sign-up, no fees, no watermark.
  • Turns a PDF's text into XML with page and paragraph structure.
  • Optionally writes the position, width and font size of each line.
  • Document info like title, author and dates can be included.
  • The output is well-formed XML; special characters are escaped.
  • The file is opened in your browser. Your files are processed, but never shared with anyone.

How to convert a PDF to XML

You need to hand the text of a report or a form to another system as data. Four steps:

  1. Choose the PDF. Load a text-based PDF (one whose text you can select).
  2. Pick the detail. Pages and paragraphs gives just the text structure; Lines and position writes each line with its place on the page.
  3. Include document info (optional). Title, author, subject and dates go into a <metadata> section.
  4. Convert and download. Press Convert to XML, preview the result and Download as XML.

What does the XML from a PDF look like?

XML is a text format that structures data with tags. The output follows this skeleton:

  • A <document> root element, with an optional <metadata> and the page count inside.
  • A <page number="1" width="595" height="842"> for each page.
  • In Pages and paragraphs mode, <paragraph> elements; in Lines and position mode, <line x="" y="" width="" size=""> elements (y is measured from the top of the page).

Characters like &, <, > and quotes in the text are escaped according to XML rules and invalid control characters are dropped, so the output opens in any XML reader. You can check the result with the XML validator.

What you need to know

  • It doesn't work on scanned PDFs. If the page is an image there's no readable text; convert it to text first with PDF OCR.
  • Tables, lines and images don't go into the XML; only the text and its position. For tables, there's extract tables from PDF.
  • Paragraph and line splits are guessed from the position of the text; with complex layouts (like multi-column text) the order can change. Words split with a hyphen at the end of a line are joined.
  • The tool doesn't produce output for a specific schema (XSD); you may need to transform the XML afterwards to fit your system.

Tips

Frequently asked questions

Is converting PDF to XML free?

Yes, it's free with no sign-up and no watermark.

Is my file uploaded anywhere?

Conversion happens in your browser. Your files are processed, but never shared with anyone.

Does the XML include tables?

No, table structure isn't extracted; lines and paragraphs are written. You can turn the table into Excel or CSV separately with extract tables from PDF.

What is the "Lines and position" mode for?

It gives each line's place on the page (x, y), its width and font size. It's used to tell headings apart by font size or to rebuild the layout.

Nothing came out. Why?

The PDF is most likely a scanned image. You need to convert it to text with OCR first.

Can I use it on my phone?

Yes, but large multi-page PDFs can strain a phone's memory.

Related tools