Text & Data

XML Formatter

Format messy XML into readable, indented markup, or minify it down to a single line.

Input
Output
Output will appear here

About this tool

XML Formatter reshapes cramped or minified XML into clean, indented markup where the nesting of elements is obvious at a glance. When you need the opposite, it can also collapse an XML document down to a single line.

It is useful for reading SOAP responses, configuration files, sitemaps, RSS feeds and build descriptors like Maven's pom.xml. Formatting is done locally in your browser, so private XML — including anything with credentials — is never transmitted.

How to use

  1. Paste your XML into the input box.
  2. Click Format to indent the elements and reveal the structure.
  3. Choose Minify to compress the XML into one line for transport.
  4. Scan the highlighted output to check the element hierarchy.
  5. Copy the result to your clipboard when it looks right.

Features

  • Pretty-print XML with clear, consistent indentation.
  • Minify XML to a single line to reduce size.
  • Preserves attributes and element order.
  • Syntax highlighting makes tags and values easy to distinguish.
  • Works with config files, SOAP, RSS, sitemaps and pom.xml.
  • Runs locally — your XML is never uploaded to a server.

Frequently asked questions

Is my XML sent anywhere for formatting?

No. Formatting and minifying happen entirely in your browser, so confidential XML such as service configs or credentials stays on your device.

Does formatting change the meaning of my XML?

No. It only adjusts whitespace and indentation between elements. The elements, attributes and their order are preserved, so the document's meaning is unchanged.

Will indentation break whitespace-sensitive content?

Formatting adds whitespace between tags. If your XML carries whitespace-significant text inside an element, review the result, since added indentation can affect such content.

What happens if the XML is malformed?

If tags are unclosed or mismatched, the formatter cannot build a clean tree. Fix the structural error first, then format again.