XML Formatter & Beautifier
Format and indent XML in your browser. Validates first and reports the exact line of any error. Free, private, nothing uploaded.
About this tool
Pretty-print single-line or inconsistently indented XML into a readable document with 2-space indentation. The input is validated first, so malformed markup is reported with its exact line and column instead of producing garbage output.
Attributes, repeated elements, and text nodes are preserved through the reformat.
Common uses
- Make a SOAP response or RSS feed readable for debugging.
- Find the unclosed tag in a document that some other tool rejected.
- Normalize XML fixtures before committing them.
Automate via API
The same conversion is available as a REST endpoint for scripts, pipelines, and backends:
curl -X POST https://payloadly.com/api/v1/tools/xml-formatter \ -H "Content-Type: text/plain" \ -H "X-Api-Key: YOUR_API_KEY" \ --data-binary @input.xml
Worked examples
Real payloads from tools people use daily, with the exact output this converter produces. Every example runs in your browser, so you can load one and adapt it to your own data.
Beautify a SOAP response
SOAP responses usually come back as one long line; indenting them makes the envelope and body readable while debugging.
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope"><soap:Body><GetPriceResponse><Price>34.50</Price><Currency>USD</Currency></GetPriceResponse></soap:Body></soap:Envelope>
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
<soap:Body>
<GetPriceResponse>
<Price>34.5</Price>
<Currency>USD</Currency>
</GetPriceResponse>
</soap:Body>
</soap:Envelope>Format an RSS feed
Indenting a minified feed makes it easy to scan channel metadata and individual items.
<rss version="2.0"><channel><title>Example Blog</title><item><title>First post</title><link>https://example.com/first</link></item></channel></rss>
<rss version="2.0">
<channel>
<title>Example Blog</title>
<item>
<title>First post</title>
<link>https://example.com/first</link>
</item>
</channel>
</rss>XML notes
XML remains entrenched in enterprise integrations, SOAP services, RSS/Atom feeds, and sitemaps. Unlike JSON, it distinguishes attributes from child elements and supports namespaces.
- XML attributes are represented with an `@_` prefix when converted to JSON.
- Repeated sibling elements become arrays; single elements become objects.
- XML documents need exactly one root element.
Frequently asked questions
Is my data uploaded to a server?
No. This tool runs entirely in your browser using JavaScript, and there are no ads on the page. Nothing you paste or drop here is uploaded, logged, or stored, and you can verify that yourself: open your browser's developer tools and watch the Network tab while you convert (no requests leave the page), or disconnect from the internet after the page loads and keep working.
Is there a size limit or a fee?
The browser tool is free with no signup and comfortably handles files up to tens of megabytes (limited by your device's memory). For automated or bulk processing inside your own scripts and pipelines, use the paid REST API.
Related tools
Convert XML to JSON in your browser. Attributes preserved with @_ prefix, repeated elements become arrays. Validates with line numbers. Free.
Validate XML well-formedness in your browser with exact line and column error locations. Free, private, nothing leaves your machine.
Convert JSON to formatted XML in your browser. Keys become elements, @_ prefixed keys become attributes. Free, private, no upload.
Format and beautify JSON in your browser with 2-space, 4-space, or tab indentation. Errors reported with line and column. Free, no upload.