Free Online XML Formatter and Validator

Make XML documents easier to read with indentation, check whether markup is well-formed, and create compact output. This browser-based XML formatter is useful for configuration files, feeds and structured documents.

Format or validate XML

Paste XML and choose an action.

This tool runs in your browser. Input content is not intentionally uploaded by this page.

How does an XML formatter work?

XML (Extensible Markup Language) stores data using nested elements and attributes. A formatter parses XML and applies indentation and line breaks to make its structure easier to inspect. Validation in this tool checks whether the document is well-formed XML; it does not validate against an external DTD or XML Schema.

How to use this XML formatter

  1. Paste the XML document into the input area.
  2. Select Format XML for indented output.
  3. Select Minify XML for compact output.
  4. Select Validate to check XML well-formedness.
  5. The formatted or minified result replaces the text in the input area. Use Copy XML text to copy the current content.

Common XML errors

  • Opening tags without matching closing tags.
  • Incorrectly nested elements.
  • Attribute values without quotation marks.
  • Unescaped reserved characters such as ampersands in text or attribute values.
  • More than one document element.

Frequently asked questions

Does the formatter validate an XML schema?

No. It checks whether the XML is well-formed. Schema validation requires the relevant XSD or DTD and a validator that supports it.

Will formatting change my XML?

Formatting changes indentation and whitespace between parsed nodes. Whitespace can be meaningful in mixed-content XML or application-specific documents, so review the result before using it in production.

Can I minify XML?

Yes. Minify XML serializes the parsed document into a compact representation. Always check the output if your application depends on whitespace.

Is my XML sent to a server?

The formatter uses your browser's XML parser and serializer. Still, avoid using sensitive data on shared or untrusted devices.

Explore related tools