ToolLineup

XML to Text Converter

This XML to text converter pulls the readable content out of a document and discards the markup around it. Element text and CDATA sections are both extracted — CDATA matters because it is where documents put content that would otherwise need escaping, and a naive tag-stripper either misses it or leaves the wrapper behind. Attribute values can be included as well, which is worth doing when the document keeps real content in attributes rather than in element text. Useful for getting the content out of an XML export, checking what a feed actually says, or feeding a document into a word counter or a translation tool.

How it works

Pulls the readable text out of a document, discarding the markup. Element text and CDATA sections are extracted; attributes can be included as well.

Useful for getting the content out of an XML export, checking what a feed actually says, or feeding a document into a word counter or a translation tool.

Everything runs in your browser — nothing you paste is sent to a server.

XML input
Paste XML…
Extracted text

What gets extracted

  • Element text — the content between opening and closing tags.
  • CDATA sections — unwrapped, with the content kept.
  • Attribute values — optionally, since some schemas put real content there.

Comments and processing instructions are dropped: they annotate the document rather than forming part of it.

Why CDATA is easy to lose

A <![CDATA[ ... ]]> section exists so that content containing angle brackets or ampersands can be included without escaping — HTML fragments and code samples usually live there. A tag-stripping regex either deletes the whole section or leaves the CDATA wrapper visible in the output. Both are handled properly here.

Frequently asked questions

How do I extract text from XML?

Paste your document into the left panel. The text content appears on the right, one value per line.

Is CDATA content included?

Yes. CDATA sections hold content that would otherwise need escaping, so skipping them would lose real text. The wrapper is stripped and the content kept.

Can I include attribute values?

Yes, with the option ticked. Some documents keep real content in attributes rather than in element text, in which case leaving them out loses most of the document.

Why one value per line?

So the structure of the source is still visible in the output. Values from separate elements are separate lines rather than being run together.

Are comments included?

No. Comments are annotations rather than content, so they are dropped.

Is my document uploaded?

No. Extraction runs entirely in your browser.

Related tools