Skip to content
hateitall

XML Formatter

Make a one-line API response, sitemap or SVG readable, or shrink a config file before shipping it.

Processed locallyIn: XML, SVG, RSSOut: XML

Loading tool…

How to use xml formatter

  1. Paste XML or open an .xml, .svg, .rss or similar file.

  2. Choose Pretty print or Minify.

  3. Set the indent, attribute layout, empty element style and whether to keep comments.

  4. Copy or download the result.

What this tool does

  • Indents nested elements and keeps short text elements on one line.
  • Leaves mixed content, such as a paragraph with <b> inside, on one line so no meaningful space is added.
  • Respects xml:space="preserve" and keeps CDATA, comments, processing instructions and DOCTYPE as written.
  • Optional one attribute per line for long tags.

How the result is verified

The output is parsed again by the browser's XML parser and its elements, attributes, text and comments are compared with the input.

Frequently asked questions

Will it change my data?

Only whitespace between tags changes, plus space around text if you leave trimming on. The re-parse check compares content and warns if anything else differs.

Does it work on SVG files?

Yes. SVG is XML, so it formats and minifies the same way.

Is my data uploaded to a server?

No. Everything you drop, paste or type is processed by code running in this browser tab. You can check it yourself: open your browser's developer tools, watch the Network panel, and use the tool. No request carries your data.

Well-formedness check with line, column and a plain hint

XML · SVG · RSS→ ReportLight on device

Beautify or minify JSON with your choice of indentation

JSON→ JSONLight on device

Readable SQL with clauses, joins and subqueries laid out

SQL→ SQLLight on device