FileBrixNo upload · Private
Processed locally — your file never leaves your device

XML Formatter

Pretty-print XML with proper indentation — entirely in your browser, using your browser's own XML parser.

Indent size

How it works

  1. Paste XML, or open a .xml file.
  2. Choose 2 spaces, 4 spaces, or tabs for indentation.
  3. Click Format — malformed XML shows a clear error instead of a result.
  4. Copy the result or download it, all without anything leaving your browser.

Frequently asked questions

Is my XML uploaded anywhere?
No. Parsing and formatting both happen locally using your browser's own built-in XML parser (DOMParser) — never a server, never a third party.
Is this safe to use on XML from an untrusted source?
Yes. Browsers' built-in XML parser does not fetch external files or resolve external entities, which is the main risk with untrusted XML (an attack technique called XXE). Nothing this tool parses can reach outside your browser tab.
Does formatting change my content?
Only insignificant whitespace changes. Elements, attributes, comments, processing instructions and CDATA sections are all preserved — this isn't a lossy conversion like XML to JSON.
What if my XML isn't well-formed?
You'll see the specific parse error instead of a formatted result.
Can I open a file instead of pasting?
Yes, there's an Open file button, or you can paste text directly.