Skip to main content

XML Formatter & Validator

XML Formatter re-indents an XML document and reports the first structural problem it finds.

How to use it

  1. Paste your XML into the input box
  2. Click Format to get a consistently indented result
  3. Read the error message if the XML isn't well-formed

It checks well-formedness only — matched tags, exactly one root element, and no text outside it — and names the first fault (an unclosed tag, a mismatched closing tag, stray text, or more than one root). It does not validate against a DTD or XSD schema, resolve or check entities such as the ampersand escape, or verify namespace prefixes; an xmlns is treated as an ordinary attribute. Indentation is fixed at two spaces per level, and whitespace inside text nodes is trimmed, so significant spacing in mixed content is not kept. Unlike the JSON tools it never rebuilds the data model, so nothing is re-ordered; there is also no XML minifier. Input is limited to 2 MB, roughly 100,000 tags and 64 nesting levels, and the document stays in your browser.

FAQ

We use cookies to run this site and, with your consent, to understand usage and personalize ads. You can change your choice at any time.