# Format your XML.
See the structure.

Source: https://xsdhub.com/xml-formatter

Format and pretty print XML in your browser. Make nested elements easier to read, preserve mixed content and copy the result. No XML uploads required.

## What pretty printing does

XML formatting adds indentation and line breaks where the serializer can do so. That makes nested elements easier to inspect while debugging a feed or integration. The formatter parses the document first, so malformed XML must be corrected before it can be formatted. Formatting alone does not check the document against an XSD.

## How to format an XML document

Paste XML or open a UTF-8 file, then choose Format XML. The result replaces the document in the editor. Use Copy to put it on your clipboard. To inspect schema requirements too, open the XSD validator and run a separate validation with the relevant schema.

## Whitespace and mixed content

Whitespace can be meaningful in XML, especially when text and elements are mixed, such as <p>Hello <b>world</b>!</p>. This formatter uses libxml2 serialization and avoids forcibly stripping all whitespace or inserting breaks inside mixed text. Always review serialized output before replacing a signed, hashed or whitespace-sensitive document. Pretty printing is not XML canonicalization.

## Local processing and limits

Formatting runs in a disposable browser worker. No XML is uploaded. Files are limited to 1 MB and UTF-8 encoding; DTD and entity declarations are rejected. If a document exceeds the processing time limit, simplify the input or use a tool designed for large files. The browser does not save your document after you close the page.
