Skip to content
UniKit

XML formatter

XML minify and format via tag-level re-flow: CDATA and comments are preserved and unterminated markup shows up in the result instead of being silently swallowed.

Runs in your browserEvery computation happens in your browser — your data never leaves this device.

XML source

Result

The result can be copied directly.

Enter XML to see the formatted result

Characters: 0 · Lines: 0

What this tool does

  • Expand a single-line markup export into a readable structure.
  • Strip whitespace between tags before shipping.
  • Compare line counts to see how much volume is pure whitespace.

Example

Input

<root><item a="1">x</item></root>

Output

<root>
  <item a="1">
    x
  </item>
</root>

Raw-text elements (script/style/pre/textarea), CDATA and comments are preserved verbatim.

Frequently asked questions

Will content be changed?

No. Only whitespace between tags is re-flowed; text nodes, attribute values, CDATA and comments stay verbatim.

What about newlines inside attributes?

Quoted attribute values are not re-flowed, so multi-line values survive.

Are unclosed tags repaired?

No. The tool performs no semantic repair; unclosed tags stay as they are.

Why are there still newlines after minifying?

Newlines inside `<pre>` / `<script>` / `<style>` are content, so only whitespace between tags is collapsed.

Keywords:xml formatterformatconverterdeveloper

Related tools