Developer tools

XML formatter and validator.

Paste XML, format or minify it, and get clear diagnostics for malformed markup.

Input

XML source

§

What is an XML formatter?

XML is a markup language used to transport and store structured data in feeds, configuration files, invoices, and APIs. A formatter re-indents the hierarchy so you can instantly see which elements are children of others — without ever touching the actual data.

Before

<config><app name="demo"><timeout>30</timeout><retries>3</retries></app></config>

After

<config>
  <app name="demo">
    <timeout>30</timeout>
    <retries>3</retries>
  </app>
</config>

Well-formed vs. valid

This tool checks well-formedness — that tags balance and the markup is syntactically correct. It does not validate against a schema (XSD or DTD), which is a separate data-contract concern.

FAQ

What is an XML formatter?+

An XML formatter (or XML beautifier) re-indents an XML document so nested elements line up consistently. It splits tags across lines and indents children, making the structure easy to read without changing any of the data.

What makes XML invalid?+

Common issues are: tags that are not closed, mismatched opening and closing tags, attributes without quoted values, duplicate attributes on one element, and unterminated comments or CDATA sections. This tool reports those as line-by-line diagnostics.

Are comments and CDATA preserved?+

Yes. Comments, processing instructions, DOCTYPE declarations, and CDATA sections are kept exactly as written and simply re-indented.

What is the difference between format and minify?+

Format adds indentation and line breaks for readability. Minify strips insignificant whitespace to produce the smallest document, which is useful when storing XML in a database or a single-line field.

About XML Formatter

Paste or load XML, then format or minify it. Formatting is deterministic and stateless — nothing is stored on the server, and your data is never rewritten.

  • Deterministic formatting with configurable indentation.
  • Minify mode for compact output.
  • Well-formedness diagnostics with line and column details.

More tools