XML Beautifier & Formatter
Paste any XML — document, SOAP envelope, RSS feed, config — get clean indented output.
What it does
XML is older than JSON and denser with ceremony — namespaces, attributes, mixed content, CDATA. When an API returns minified XML in a single line, it's nearly impossible to read without tooling.
convert2 walks the XML, re-emits each tag on its own line with proper depth indentation, respecting void elements and comments. The whole thing happens inside your browser with a small custom parser — no XML library pulled from a CDN.
How to use it
- Paste your XML into the left pane.
- The indented version appears on the right, one element per line.
- Self-closing tags (
<br/>,<img/>) render correctly. - XML declarations, DOCTYPEs and comments are preserved.
- Choose indent width (2, 4, TAB) from the top-right control.
Example
<?xml version="1.0"?><catalog><book id="1"><title>Hobbit</title><author>Tolkien</author></book><book id="2"><title>Dune</title></book></catalog>
<?xml version="1.0"?>
<catalog>
<book id="1">
<title>Hobbit</title>
<author>Tolkien</author>
</book>
<book id="2">
<title>Dune</title>
</book>
</catalog>
Why convert2
- Private. XML often carries PII (names, addresses, bank payloads in SOAP). Keeping it local matters.
- Handles the edge cases. Self-closing void tags, CDATA sections, processing instructions, XML declarations and HTML-style comments all pass through intact.
- Namespace-preserving.
xmlns:soap,xsi:typeand friends are not rewritten. - No library bloat. A small custom parser — the page doesn't pull a multi-megabyte XML library.
Common use cases
- Formatting SOAP request/response envelopes during API debugging.
- Cleaning up RSS or Atom feeds before parsing them elsewhere.
- Reading Android
AndroidManifest.xml, Mavenpom.xml, Spring config files. - Inspecting OOXML (
.docx,.xlsx) parts after unzipping. - Formatting SVG for hand-editing paths.
XML Beautifier specifics
- Whitespace-only text nodes between elements are stripped. Significant text content is kept.
- The formatter doesn't validate against a DTD or XSD — it's a structural pretty-printer, not a validator.
- Mixed content (text next to child elements) is preserved but may not indent as prettily as pure-element docs.
- If your XML comes from HTML, use the HTML mode instead — it understands void elements like
<br>without the closing slash.
Frequently asked questions
Does it handle SOAP envelopes and large XML?
Yes. It handles standard XML including SOAP, RSS and Atom feeds, and respects self-closing tags, namespaces and comments. Tested smoothly on multi-megabyte files.
Can it validate against a schema?
No — convert2 is a pretty-printer, not a validator. For schema validation use an XSD-aware tool locally.
Does it preserve attribute order?
Yes. Attributes are written back in the order they appear in the input.
What about CDATA and processing instructions?
Both pass through unchanged.