XML Formatter

Transform minified XML into readable format with proper indentation. Automatic syntax validation and formatting.

Options

Number of spaces for indentation

All About XML Formatting

When you need XML Formatter

When debugging SOAP responses, analyzing RSS feeds, working with Maven/Spring configs, exploring Office document structure. Formatting is the first step to understanding an XML document.

XML in modern development

JSON replaced XML in most APIs, but XML remains the standard in enterprise: SOAP, banking, EDI, government systems. Android layouts, Maven pom.xml, Spring configs β€” all XML.

Common XML errors

Unclosed tags, improper nesting, unquoted attributes, unescaped characters (&, <, >), BOM at file start, case mismatch between opening and closing tags.

Well-formed vs Valid XML

Well-formed means syntactically correct XML. Valid means conforming to a schema (DTD or XSD). The formatter checks well-formedness. Schema validation needs specialized tools.

Tools for working with XML

Oxygen XML Editor, XMLSpy (professional). VS Code with XML Tools. xmllint for command line. XPath/XSLT for transformations. Online formatters for quick tasks.

How to format XML

1

Paste XML

Enter XML in the text field or upload a file. Files up to 10 MB are supported.

2

Choose indent

Select indent size: 2 or 4 spaces. 2 spaces are more compact, 4 are more visual.

3

Copy result

Click "Format" and copy the formatted XML. Syntax errors will show problem description.

Frequently Asked Questions