Your files stay with you.
XML→XML

XML Formatter & Validator

Pretty-print messy XML with clean indentation, minify it to one line, and find out exactly where it’s broken.

Your files stay with you. Nothing uploaded. Nothing saved.

Loading the converter…

How to use the XML Formatter & Validator tool

  1. Paste your XML into the input box.
  2. Choose Format or Minify, and the indent you prefer.
  3. Copy or download the result. Errors are explained below the boxes.

Format or minify?

Format puts each element on its own line with indentation that shows the structure, so you can read API responses, sitemaps, RSS feeds and config files. Minify removes the whitespace between tags to make the file smaller for sending or storing. Comments, CDATA sections, processing instructions and attributes are kept either way.

Fixing “not well-formed” errors

  • Every opening tag needs a matching closing tag, or must close itself like <br/>.
  • Tags must close in the reverse order they opened.
  • A bare & or < inside text must be written as &amp; or &lt;.
  • There must be exactly one root element around everything else.

Working with JSON instead? Use the JSON Formatter & Validator.

Frequently asked questions

What makes XML invalid?

Common causes are a tag that isn’t closed, tags closed in the wrong order, an unescaped & or < in text, attribute values without quotes, or more than one root element.

Does it check against a schema?

No. It checks that the XML is well-formed. Validating against an XSD or DTD needs the schema and a dedicated validator.

Are my files uploaded to a server?

No. HushConverts converts everything with code that runs in your browser, so your text and files stay on your device. You can even use most tools offline once the page has loaded.

More encoding & developer