XML Formatter & Beautifier

Format and indent XML in your browser. Validates first and reports the exact line of any error. Free, private, nothing uploaded.

XML inputpaste, type, or drop a file
XML output
Runs 100% in your browser. Nothing is uploaded, logged, or stored, and there are no ads. Verify it yourself: open your browser's Network tab while you convert and watch that no requests leave this page.

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

API documentation · Get an API key

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.

XML input
<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>
XML output
<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.

XML input
<rss version="2.0"><channel><title>Example Blog</title><item><title>First post</title><link>https://example.com/first</link></item></channel></rss>
XML output
<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