Messy input
<note><to>Ada</to><from>Bob</from><body>Hi there</body></note>The XML Formatter pretty-prints compact or minified XML into a clean, indented document tree. It places each element on its own line, indents nested children, and tidies attribute spacing so the hierarchy is easy to read. It can also collapse formatted XML back to a compact form. Processing happens entirely in your browser, so configuration files, SOAP payloads, and feeds with sensitive data are never uploaded.
XML (eXtensible Markup Language) is a self-describing, tree-structured format used for configuration, documents, RSS and Atom feeds, SOAP web services, and data exchange between systems. Its verbose, nested syntax is precise but hard to read when stripped of whitespace. Reformatting restores the indentation that reveals parent/child relationships, making it far easier to navigate large documents, debug feeds, and confirm that elements are properly nested and closed.
The main file is the entry point for each run.
Use the Input panel to pipe standard input to your program when it needs data.
Run sends your code to a fresh hosted runtime and streams the result into the output panel.
Your draft stays in this browser, and Share creates a separate snapshot link.
<note><to>Ada</to><from>Bob</from><body>Hi there</body></note><note>
<to>Ada</to>
<from>Bob</from>
<body>Hi there</body>
</note><catalog>
<book id="b1" lang="en">
<title>XML Basics</title>
<price>29.99</price>
</book>
</catalog><?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
<channel>
<title>News</title>
<item>
<title>First post</title>
<link>https://example.com/1</link>
</item>
</channel>
</rss><h:table xmlns:h="http://www.w3.org/TR/html4/"><h:tr><h:td>Apples</h:td><h:td>Bananas</h:td></h:tr></h:table><h:table xmlns:h="http://www.w3.org/TR/html4/">
<h:tr>
<h:td>Apples</h:td>
<h:td>Bananas</h:td>
</h:tr>
</h:table><config>
<!-- connection settings -->
<db>
<query><![CDATA[SELECT * FROM users WHERE id < 10]]></query>
</db>
</config><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><getPrice><item>Apples</item></getPrice></soap:Body></soap:Envelope><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<getPrice>
<item>Apples</item>
</getPrice>
</soap:Body>
</soap:Envelope><form>
<field name="email" type="text" />
<field name="agree" type="checkbox" />
<submit label="Send" />
</form>The editor uses Monaco, the engine behind VS Code, with language-aware editing tools and familiar keyboard controls.
Paste compact or minified XML and it pretty-prints an indented document tree.
Each element is placed on its own line with nested children indented.
Can also collapse formatted XML back to a compact form.
Attribute spacing is tidied so the hierarchy is easy to read.
Restores indentation that reveals parent/child relationships.
Handles config files, SOAP payloads and RSS/Atom feeds.
Processing happens entirely in your browser; XML is never uploaded.
Feeds and payloads with sensitive data stay on your machine.
Copy the formatted XML to navigate large documents more easily.
Helps confirm that elements are properly nested and closed.
Output
Start typing to auto-process