APILens open source
Full tool ↗ GitHub ↗

XML Formatter — beautify or minify XML

Paste XML to pretty-print it with indentation, minify it to one line, or explore it as a collapsible tree. Everything runs locally in your browser.

Formatted XML appears here.

XML formatter — frequently asked questions

What does an XML formatter do?

It rewrites XML with consistent indentation so nested elements are easy to read. Minify does the opposite — it strips whitespace between tags to shrink the file for transfer or storage.

Is my XML uploaded to a server?

No. Formatting and minifying run 100% in your browser. Your XML never leaves your machine — APILens has no analytics and no ads.

Does it validate the XML?

It checks well-formedness (matching tags, no parser errors) before formatting. If the XML is malformed, you'll see an error instead of a result. Use a schema validator for DTD/XSD conformance checks.

Will formatting change my data?

No. Only the whitespace between elements changes; element text content, attributes and structure are preserved exactly. Mixed content (text between nested elements) is kept on its own line.

Can I convert XML to JSON here?

The tree view reads XML as a nested structure so you can inspect it. For API work, APILens also handles JSON formatting, JSON diff and JSONPath.

Is there a Chrome extension?

Yes — APILens ships as an open-source Chrome (MV3) extension. Both are MIT-licensed on GitHub.