01 / Example
Example
<root><message>Hello</message><count>2</count></root><root>
<message>Hello</message>
<count>2</count>
</root>Code Beautify / MULTIVERTO
Indent simple well-formed XML with visible nesting.
Apply each text tool to the previous result. Text workflows ↗
Only the recipe name and tool order are saved in this browser. Your input and results are never saved.
01 / Example
<root><message>Hello</message><count>2</count></root><root>
<message>Hello</message>
<count>2</count>
</root>02 / Guide
Indent simple well-formed XML with visible nesting. The XML formatter shows the depth of a simple element tree and requires a matching end tag for every nonempty start tag. It preserves text values while re-laying out element-only children. A declaration, DTD, CDATA section or comment requires another tool.
XML requires one root element, matching closing tags, quoted attributes and correctly escaped special characters. Unlike forgiving HTML parsing, malformed XML should be rejected. This local tool handles a simple element tree; declarations, document type definitions, comments and CDATA are outside its supported subset. It keeps non-empty text values unchanged and formats or compacts whitespace between element-only children.
Choose a well-formed XML sample with an explicit root and matching closing tags. The formatter lays out element-only nesting so parent, child and sibling relationships are easier to inspect. It is intended for its documented subset, not for arbitrary declarations, document type definitions or mixed-content layouts. Preserve the original bytes if another system signs the document or compares it byte for byte. Read the first and last tags after formatting to make sure the intended root is still visible, then review any namespaces and attributes that identify downstream records. In the live example, with line breaks shown as JSON escapes, input "<root><message>Hello</message><count>2</count></root>" produces output "<root>\n <message>Hello</message>\n <count>2</count>\n</root>". For an XML configuration, move one child from a nested group to the root in a copy and format both versions. Their different indentation should expose the structural change. Check the application’s parser afterward; attractive indentation does not prove a namespace prefix or entity declaration is accepted.
For a small configuration or response, indentation can reveal which XML element actually owns a child. Check that namespaces, attributes, entity text and closing tags remain paired. Do not treat this as XML validation against a DTD or schema; declarations, comments, CDATA and mixed content need a parser that understands those document features. Parse the result with the receiving application or its own XML validator before replacing a source document. Compare element names, attribute values, repeated children and text values against the original. In XML, whitespace can itself be a text node, so visual indentation is not always harmless inside mixed content. If the document carries a signature, a layout change can invalidate it even when the tree appears equivalent. Do not treat a readable hierarchy as schema validation. Keep a failing input intact for diagnosis rather than deleting unfamiliar constructs until it happens to parse.
Explore guides