Skip to content

XML Formatter

Pretty-print XML in your browser with your chosen indentation. Entities stay decoded, attributes are kept, and broken markup is reported by the parser.

Paste XML

Indentation

Formatted XML

Paste XML, then format.

The formatted XML appears here.

Limit for uploaded files: 10 MB. Pasted text is not truncated by the tool — your browser’s memory is the ceiling.

Your file is never sent to a server. It is read and processed by your own browser, and the results are not stored.

How to use it

  1. Paste XML, or choose an .xml file.
  2. Pick the indentation: two spaces, four spaces or a tab.
  3. Format, then copy the result or download it.

Limits worth knowing

  • Output is well-formed XML, not schema-validated against XSD.
  • External entity references are never resolved.
  • Comments are preserved only when the parser keeps them; some constructs are normalised.
  • Files above 10 MB are refused to keep the tab responsive.

Why XML still needs a formatter

XML from machines arrives as one line; XML from humans arrives with inconsistent indentation that makes nesting invisible. A formatter makes the tree readable, which is usually the fastest route to spotting a misplaced close tag.

Because the document is parsed and re-serialised, the output is guaranteed well-formed if it prints at all — a silent corrupter is worse than anything else.

Formatting versus validation

This tool re-serialises structurally; the XML Validator tool answers whether the input is well-formed and where the first error is. Use the validator first when you suspect a broken file, then the formatter on the fixed input.

Frequently asked questions

Does XML Formatter upload my files to any server?

No. XML Formatter runs in your browser, and the file is read there rather than sent to a server for processing. Our host still sees ordinary page-request metadata, which is described on the privacy page.

Is XML Formatter free to use?

Yes, XML Formatter is free, with no paid tier, no account, and no watermark added to your output. The limits are technical rather than commercial: file size, page count and supported formats are listed on this page.

What file formats and sizes are supported?

XML Formatter supports .xml, .svg, .xaml, .xsd, .xsl, .txt files up to 10MB directly in your browser.

Does formatting change what the XML means?

No. Elements, attributes and text content are re-emitted in the same order. Insignificant whitespace between tags may change because the output is re-indented.

Can it handle entities?

Yes. Predefined and numeric character references are decoded and re-encoded consistently, so & stays & and will not break the re-parsed document.

What about DTDs and external entity references?

They are never resolved. The tool reads structure only; a SYSTEM entity that would fetch a remote file is refused by design, so the tool cannot be used to probe internal services.

Is my file uploaded?

No. Formatting runs in this tab; nothing about the file leaves your device.