DevMate
Back to Toolverse

Development

XML Formatter

Indent simple XML-shaped data so opening and closing tags are easier to inspect. Preserve the original when whitespace is meaningful.

Local processing
Loading tool workspace...

About this tool

When to use it

Indent simple XML-shaped data so opening and closing tags are easier to inspect. Preserve the original when whitespace is meaningful.

How to use it

Paste a small element-oriented document and select Format XML. Check the nesting and any reported mismatched tag, then copy or download the formatted text. Use XML-to-JSON only when changing the data representation is intentional.

Guide updated . Examples checked against this implementation.

Worked examples

Indent a simple element

Input

<job><name>build</name></job>

Expected output

<job>
  <name>
    build
  </name>
</job>

Text and tags are split across lines. This adds whitespace inside elements, which can change the text seen by an XML consumer.

Errors and unsupported input

<job><name>build</job>

Close name before job. Matching tag names and nesting must be repaired before formatting can finish.

Continue this workflow

Questions

Frequently asked questions

Does successful formatting prove the XML is valid?

No. Validate with the parser and schema used by the receiving application. This tool primarily makes simple nesting visible.