XML Layout Workbench
Re-indent XML without changing what it means — entities, CDATA and significant whitespace all survive.
Up to 2 MiB, 128 levels, 100,000 nodes. Nothing leaves your browser.
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.
<?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.defaultturns 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.
How to use this calculator
- Paste your XML, choose an indent and a line ending, and read the formatted output.
- Copy or download it. A document that will not parse is reported with the position rather than reformatted.
How it works
Formatting changes only the whitespace between elements. Text content, attribute values, CDATA sections and processing instructions are passed through byte for byte.
Entities are not decoded and rewritten. & stays &, because writing it back as a bare & would produce a document that no longer parses.
Nothing is fetched. A DOCTYPE that points at an external entity is not resolved — that is how an XML parser becomes a way to read files off a server.
Worked example
An attribute holding markup. Given t="<b>", the formatter leaves the attribute exactly as written. Decoding it would turn the document into one with a stray tag inside an attribute.
Common mistakes
- Expecting formatting to fix a malformed document — it will not guess where a tag was meant to close.
- Assuming whitespace inside an element is insignificant. In mixed content it often is not, so it is left alone.
- Relying on a formatter to validate against a schema; this checks that the document is well-formed, not that it is correct.
Tips
- Runs entirely in your browser. Your input is not uploaded or stored.
Frequently asked questions
Will it resolve my DOCTYPE?
No. External entities are never fetched or expanded, which is the whole of the XXE problem avoided rather than mitigated.
Why is my one-line file still one line inside an element?
Because that element has mixed content, where whitespace can be meaningful. Breaking it would change the document.
Is anything uploaded?
Runs entirely in your browser. Your input is not uploaded or stored.
Related tools
- YAML JSON Workbench
- JSON Table Exporter
- Local ZIP Workshop
- JSON Formatter & Minifier
- Base64 Encoder / Decoder
- CSV to JSON Converter
Explore more in PDF, Image, File, Data & Developer Tools.
Cite this tool
Zerdly. (2026). XML Layout Workbench. Retrieved from https://www.zerdly.com/tools/xml-layout-workbench/
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.



