About the XML to Text Converter
This converter pulls the human-readable text out of an XML document. Tags, comments, the XML declaration and doctype are removed; entities such as & and © are turned back into characters; and CDATA sections are kept as text. Each element's text goes on its own line, or you can join everything into one paragraph. You can also include attribute values, which often hold IDs, titles or URLs. It works with RSS feeds, sitemaps, SVG, XHTML, Office XML parts and any other XML.
Updated October 2026
How to use the XML to Text Converter
- 1Paste your XML into the left box.
- 2Choose whether to join the text into one paragraph.
- 3Tick Include attribute values if you need them.
- 4Read the plain text on the right.
- 5Copy it or download a .txt file.
Typical uses
Pull article text out of an RSS or Atom feed, read the words in a Word or PowerPoint XML part, collect the URLs in a sitemap by including attribute values, or get the text out of an SVG to check spelling. Translators also use it to see all the translatable strings in a resource file.
Lines or one paragraph
Line mode starts a new line at every tag boundary, which keeps titles, list items and table cells apart. Paragraph mode joins everything with spaces, which suits text you want to paste into a document or a word counter. Inline tags like <b> also start a new piece in line mode, so formatted words appear on their own lines.
What gets removed
These parts of an XML file are never part of the text.
- Element tags and their names
- Comments <!-- … -->
- The <?xml … ?> declaration and other processing instructions
- The DOCTYPE and its internal subset
- Namespace declarations
Whitespace
Runs of spaces, tabs and line breaks inside each piece of text are collapsed into single spaces and trimmed, so indentation in the XML doesn't leak into the result.
Characters and encodings
The text keeps every character from the XML, including accented letters, symbols and other scripts, because the tool works on the text exactly as pasted. If an XML file shows strange characters when you open it, it was probably read with the wrong encoding; open it as UTF-8 in your editor before copying it here. The download is saved as UTF-8 too.
Getting XML from a file
Open the .xml, .rss, .svg or .xhtml file in any text editor, select all and copy. For Word, Excel or PowerPoint files, rename a copy from .docx to .zip, open it, and look inside the word, xl or ppt folders for the XML parts, such as document.xml.
Phone and computer
Paste on any device; the text updates as you type or change an option. For JSON data use the JSON to Text Converter, and XML to JSON Converter changes the structure.
Features
- Removes tags, comments and declarations
- Decodes named and numeric entities
- Keeps CDATA content
- One line per element, or one paragraph
- Optional attribute values
- Forgiving with imperfect XML
Frequently asked questions
How do I extract text from XML?
Paste the XML and the text between the tags appears on the right, one piece per line. Copy it or download it.
Does it handle & and other entities?
Yes. The five XML entities, and numeric codes like € or € become the real characters.
What happens to CDATA?
The content of a CDATA section is kept exactly as written, because it is text that was simply protected from being read as markup.
Will it include attribute values?
Only if you tick the option. Namespace declarations (xmlns) are always left out, because they are addresses, not content.
What if my XML has errors?
The extractor is forgiving and still pulls out the text from most broken files. To find the error itself, use the XML Formatter, which reports problems.
Is anything uploaded?
No. The XML is processed in your browser.