XML Layout Workbench

Re-indent XML without changing what it means — entities, CDATA and significant whitespace all survive.

100% FreeRuns in your browserBasic

Up to 2 MiB, 128 levels, 100,000 nodes. Nothing leaves your browser.

Line endings

Well-formed syntax. 27 tokens.

That means the tags match and the document parses. It is NOT validation against a DTD or an XSD — this tool has no schema and never fetches one.

Formatted XML
<?xml version="1.0" encoding="UTF-8"?>
<catalogue xmlns:ns="urn:example">
  <!-- order matters -->
  <item id="1" ns:kind="book">
    <title>Hello <b>world</b> !</title>
    <tags/>
  </item>
  <item id="2">
    <title>Plain</title>
    <notes xml:space="preserve">  kept  </notes>
  </item>
</catalogue>

What this formatter will not touch

  • Mixed content. In <p>Hello <b>world</b> !</p> those two spaces are content. One character of text anywhere in an element and its whole child sequence is emitted exactly as you wrote it.
  • xml:space="preserve" and everything inside it, byte for byte. default turns it back off, which is what the attribute is for.
  • Your lexical choices. Attribute order, single or double quotes, namespace prefixes, <b/> staying <b/> rather than becoming <b></b>, comments, CDATA and processing instructions. Nothing goes through a DOM, which is what normally loses these.

A DOCTYPE is refused rather than ignored: it can declare external entities, and this tool will not resolve one or fetch anything over the network. There is no minify option, because one cannot be offered until it can prove it preserves mixed content.

Runs entirely in your browser. Your input is not uploaded or stored.

Tip: Enter any known values to calculate the remaining results.

Designed to run locally in your browser. Tool inputs are not intentionally stored by Zerdly unless stated otherwise.