ShadTools

XML Formatter

Format minified or uneven XML with readable indentation while preserving elements, attributes, comments, and declarations.

XML input
Formatted XML

Make XML readable

The formatter validates the document, parses it in source order, and rebuilds it with consistent indentation. Use two spaces for compact configuration files or four spaces for a wider visual hierarchy.

Frequently Asked Questions

Does formatting change XML values or attributes?+

The formatter preserves the parsed XML structure, values, attributes, comments, and declaration while changing insignificant layout whitespace.

Can the formatter identify malformed XML?+

Yes. Invalid input produces a syntax message with the reported line and column instead of formatted output.

Are namespaces supported?+

Yes. Namespace prefixes and xmlns attributes are retained as part of the XML structure.

Related Tools