XML to Text Converter
Extract and clean text content from XML structures
Keep the words, drop the markup
XML wraps content in tags that are useful to software but distracting to people. This tool parses pasted XML and returns only the text inside it. You can take the entire document or restrict the output to one element name, such as title or email, which is handy for pulling a single field out of a long file.
How to extract text
- Paste XML into Input XML. Sample loads a small users list, and the character count in the header updates as you type.
- Choose Extract All Text or Specific Tag Only. For the second option, type the element name in the Tag Name box; the match is case-sensitive.
- Set Clean Whitespace to trim each line and remove blank ones, and New line per tag to put each piece of text on its own line.
- Press Extract Text. Read the result and use Copy or the .txt button, which saves extracted_text.txt.
The summary line states how many lines were produced. If the XML is malformed, an Invalid XML dialog appears instead.
The second button: Extract JSON
Next to the main button is Extract JSON, which ignores the text options and instead converts the whole document to a JSON structure with two-space indentation. Attributes are collected under @attributes and text nodes appear as #text entries. The output is displayed in the same box and downloads as a .txt file, so rename it to .json if needed. For a more configurable XML to JSON conversion, use the dedicated tool.
Ways people use it
- Pulling all the paragraph text out of an XML or XHTML export to proofread it.
- Grabbing every value of one field, such as all email addresses, from a data file.
- Checking what human-readable content a feed actually contains.
- Feeding only the wording of a document into a word counter or translation tool.
Behavior worth knowing
Attribute values are not included in the text output, only element content. With New line per tag switched off and Extract All Text selected, the text of the document is joined as one block, so neighboring values may run together. Specific Tag Only with an empty Tag Name falls back to extracting everything. Tag matching returns the full text content of each match, including text from nested children.
Related Tools
Related Tools