Format XML containers or check XML syntax. Inspect nested elements while keeping mixed text and CDATA unchanged.
How to use
Paste XML and choose format or validate. Fix parse errors before copying the result. DTD declarations are rejected by this tool.
Example
<root><item>A</item><item>B</item></root> gains indentation around its child elements, making the structure easier to scan.
FAQ
Why is some content not indented?
Mixed text and CDATA are preserved to avoid changing their meaning. Syntax validation does not validate a document against an XSD schema.
Related tools
A practical task
Before changing indentation, check if the document contains mixed text or explicit space preservation. Configuration XML and prose with inline tags have different whitespace needs. Keep the original when an external system compares exact bytes.
Another useful question
Does valid XML mean a specific feed is accepted?
No. A feed can require a schema, namespaces, and particular fields. Syntax validation is only the first check before those format rules.
Settings and formats
| Field | Values |
|---|---|
| Operation | Format (format); Validate (validate) |
Details for interpreting the result
| Detail | Explanation |
|---|---|
| XML elements | XML requires properly nested tags and a single document element. A matching closing tag is part of the structure. A parser error near one location can be caused by a missing tag earlier in the document. |
| Mixed XML content | An XML element can contain both words and child elements. Adding indentation inside that content can insert meaningful whitespace. Preserve mixed text, CDATA, and explicit space preservation instructions. |
| Syntax and schema | A document can be syntactically valid yet contain the wrong fields or types for an application. Syntax checks confirm the format; schema and business rules determine if the receiving system can use the data. |
| HTML character references | Character references such as & describe a character inside HTML. A reference can be escaped again when nested in another source. Decoding one layer is different from decoding every layer of a value. |
| HTML and plain text | HTML tags describe structure. Plain text displays characters without interpreting them as tags. Decide which result you need before removing markup, escaping brackets, or pasting output into an editor. |
| Encoding and encryption | Encoding changes how data is represented so another system can read it. It does not require a secret key. Encryption protects information with a key, while hashing produces a digest for a different purpose. |
| Line endings | A line break can use LF or CRLF. They look similar in an editor but contain different characters. Byte comparisons and checksums depend on the exact representation, including a final line break. |