data · format

XML Pretty-Printer

Re-indents XML with 2 spaces per level: one element per line, text-only elements kept inline, attributes preserved in order, comments kept. The document is parsed and re-serialised, so the tree is identical — only whitespace between elements changes.

Workspace Files stay on your device
A little guidance. A better result.

How to use XML Pretty-Printer

Re-indent XML 2 spaces per level — same tree, attributes and comments preserved.

  1. Prepare your input

    Paste well-formed XML.

  2. Use the workspace

    Inspect the re-indented document.

  3. Check your result

    Check attributes, comments and text in your consuming application.

Know the limits

Whitespace can be significant in mixed-content XML; inspect documents where spaces affect visible text.

Where does my input go?

This browser tool processes your input on your device. Optional analytics is a separate choice; it is not needed to use the tool. Keep your original until you have checked the result.

Read the privacy details →
Made for the work in front of you.Report a problem ↗