Text content with spacing
- Input
- <note>hello world</note>
- Output
- <note>hello world</note>
In XML any character data may be significant, and there is no equivalent of HTML's inline-element convention. Text content is therefore left exactly as written.
This tool indents XML so a document's structure is visible, compresses it for transport, and validates it well enough to find the mistake. Unlike HTML, XML has no convention that lets a tool decide whitespace inside an element is unimportant — any character data may be significant — so only the whitespace between elements is touched.
Runs entirely in your browser — nothing you paste is uploaded.
How to
Type, paste, or load an .xml file. Validation runs as you type, so a mistake is reported immediately.
Formatting indents each level so the nesting is clear. Minifying strips the whitespace between elements without touching text content.
An unclosed or mismatched tag is reported with the line it occurs on, rather than a bare statement that the document is invalid.
Copy the formatted or minified XML, or download it as a file.
Examples
In XML any character data may be significant, and there is no equivalent of HTML's inline-element convention. Text content is therefore left exactly as written.
Whitespace that sits entirely between two tags is formatting rather than content, so it is the only whitespace minification removes.
CDATA exists precisely to hold content that must not be interpreted, so its contents are copied through byte for byte.
Why use it
Only whitespace lying entirely between elements is removed. Text nodes and CDATA sections come through unchanged.
Validation reports the line where the document stops making sense, which is the difference between a fixable error and a shrug.
Formatting is a single pass, so a sizeable feed or configuration file reindents without freezing the browser.
XML frequently carries invoices, payroll or patient data. None of it is uploaded here.
Good to know
Summary
FAQ
Discover