XML Formatter

Paste XML to validate and pretty-print it with clean indentation. The formatter runs locally, so your XML is never uploaded.

Loading…

About the XML Formatter

This tool turns compact or messy XML into readable, indented markup. It parses the document first, so malformed XML is reported as an error instead of producing a misleading result. Formatting is useful when you receive API payloads, sitemap files, SOAP messages, RSS feeds or config snippets as one long line.

How to use it

  • Paste your XML into the input box.
  • Choose two or four spaces for indentation.
  • Copy the formatted XML back to your editor or ticket.

The formatter changes whitespace between tags only. Element names, attributes, namespaces and text values are preserved by the browser XML parser. If your input contains invalid markup, fix the first reported error and run it again. Everything happens in your browser, so the XML you paste is not sent to a server.

Frequently asked questions

Does the XML formatter validate my XML?

Yes. The browser parses the XML first and the tool shows an error when the document is not well formed.

Will formatting change XML attributes or values?

No. Formatting only changes whitespace and line breaks around tags. Attribute names, values, namespaces and text content are kept.

Can it format RSS, SOAP or sitemap XML?

Yes. Any well-formed XML document can be formatted, including feeds, SOAP envelopes and sitemap files.

Is my XML uploaded?

No. Parsing and formatting run in your browser, so the XML stays on your device.

Related tools