Format a simple element tree
Input
<root><item>one</item><item>two</item></root>Example output
<root>
<item>one</item>
<item>two</item>
</root>Format or minify well-formed XML entirely in your browser, with indentation and comment controls. The tool checks well-formedness — not XSD or DTD validity — and preserves tag values exactly, including leading zeros and text spacing.
| Accepted input | Well-formed XML text; DOCTYPE and ENTITY declarations are rejected |
|---|---|
| Operations | Format with 2-space, 4-space, or tab indentation, or minify; self-closing tags and comment preservation are configurable |
| Max input size | 5 MB |
| Execution deadline | 3 s |
| Processing location | Browser-only: pasted input is not uploaded |
Input
<root><item>one</item><item>two</item></root>Example output
<root>
<item>one</item>
<item>two</item>
</root>Input
<root><code>00123</code><text> hello </text></root>Example output
<root>
<code>00123</code>
<text> hello </text>
</root>Tag and attribute values are never coerced: leading zeros such as 00123 and spaces inside text are preserved exactly in both format and minify modes.
Minify strips only inter-element whitespace-only nodes; significant text content is left untouched.
DOCTYPE and ENTITY declarations are rejected for security reasons. Literal occurrences inside CDATA sections or comments are not treated as declarations.
Documents that fail well-formedness validation are rejected with the parser message and, when available, the line and column where validation stopped.
JSON Formatter
Prettify, indent, and format JSON strings with customizable indentation and key sorting.
JSON ↔ YAML Converter
Convert bi-directionally between JSON and YAML with strict alias and cycle protection, custom indentation, and swap support.
Text Diff / Compare
Compare two text files, code snippets, or configuration payloads line-by-line, word-by-word, or as a unified patch.
Base64 Encoder / Decoder
Encode UTF-8 text to standard or URL-safe Base64 and decode Base64 back to text.
No. The tool checks that XML is well-formed and reports where parsing stops; it does not validate against an XSD or DTD schema.
No. Values are never coerced: leading zeros, text spacing, and attribute values are preserved exactly. Formatting rewrites structural whitespace and indentation, may convert empty elements to or from self-closing form per that option, and drops comments only when comment preservation is off.
Comments are preserved unless you disable comment preservation. In tested cases CDATA sections, namespaces, attributes, and element order are carried through formatting and minification; XML declarations and mixed-content edge cases are not guaranteed.
Formatting fails when the document is not well-formed — for example unclosed tags or mismatched elements. The error message includes the parser reason and, when available, the line and column.
External entity resolution would allow XXE-style attacks, so declarations are rejected before parsing. Only literal text inside CDATA or comments is exempt from that check.
Inputs are bounded by the documented input size and execution runs under the tool deadline; very large documents may exceed either boundary.