XML Prettify
Format and indent minified XML into clean, readable markup, live as you type.
<?xml version="1.0"?>
<note>
<to>Alice</to>
<from>Bob</from>
<body>Hi!</body>
</note>Re-indents XML based on tag nesting, live as you type. Runs entirely in your browser; nothing you type is sent anywhere.
Need the opposite? XML Minifier
What is XML Prettify?
Paste minified or single-line XML and get it reformatted into clean, indented markup instantly, based on tag nesting depth. Useful for making a single-line SOAP response, RSS feed, or config file readable before you review or edit it, the kind of file that's often minified in transit but painful to read that way. Formatting runs entirely in your browser.
How to Use XML Prettify
- 1
Paste the Minified XML: Enter single-line or compact XML.
- 2
Read the Formatted Result Instantly: The indented markup appears automatically as you type.
- 3
Copy the Result: Use the copy button to copy the readable XML.
How It Works
The document is scanned tag by tag: an opening tag increases the indentation depth for everything after it, a closing tag decreases it back, and a self-closing tag stays at the current level. Each line is then re-indented based on that running depth, turning a single-line or minified document into properly nested markup.
Example
<note><to>Alice</to><text>Meeting at noon</text></note><note>
<to>Alice</to>
<text>Meeting at noon</text>
</note>Each child element moves to its own line, indented one level inside its parent `<note>`.
Common Use Cases
Making a single-line SOAP response, a minified RSS feed, or a compressed config file readable before you review or edit it by hand. It's the kind of file that's compact in transit but painful to read that way.
Frequently Asked Questions
Common questions about XML Prettify.