WizzyTools

Format and beautify XML online

Works offline · never uploaded

Pretty-print or minify XML instantly in your browser, with adjustable indentation.

Updated

/ 5 - Be the first to rate this tool Thanks for rating!

Verification failed - please try again.

How it works

  1. 1

    Paste your XML into the Input box.

  2. 2

    Pick an indent width.

  3. 3

    Press Format to indent it or Minify to compact it.

  4. 4

    Copy the output.

About the XML Formatter

XML from SOAP services, sitemaps, RSS feeds and older config systems is often delivered with every tag on one line. This formatter splits the markup into tags and text, then places each element on its own line with indentation that follows the nesting. It can also do the reverse and strip the whitespace between tags, which is handy when a system expects compact XML.

What you can do

  • Indent nested elements with 2 spaces, 4 spaces or a tab.
  • Minify markup by removing the whitespace between tags and trimming text nodes.
  • Keep comments, CDATA sections, processing instructions such as the XML declaration, and DOCTYPE lines exactly as written.
  • Place text content on its own indented line beneath the element that contains it.

When it works best

  • Reading a sitemap.xml or RSS feed that a CMS produced as a single line.
  • Inspecting a SOAP envelope or SAML assertion copied from a log.
  • Tidying an Android layout or Maven pom.xml snippet before pasting it into a code review.

Things to know

  • Everything runs in your browser, so internal payloads are not uploaded.
  • This is a formatter, not a validator: it does not check that tags are balanced or that the document is well formed, so broken XML is indented as far as it can be rather than rejected.
  • Because text gets its own line, formatting can add whitespace around values in mixed content. Use Minify, or keep the original, where whitespace is significant.
  • To convert XML into JSON objects instead of reindenting it, use XML ↔ JSON.

Frequently asked questions

No. Broken markup is indented as far as possible rather than rejected.

Yes, along with processing instructions and DOCTYPE lines.

Text content is placed on its own line. Use Minify where whitespace matters.

No, use XML ↔ JSON for that.