Skip to main content
ToolsBay

Runs in your browser — nothing is uploaded · verify

XML Beautifier — free, and it runs in your browser

Format, minify and check XML without mangling CDATA or attributes.

  • Re-indent minified or machine-written XML into something you can read.
  • CDATA sections, attributes and xml:space="preserve" are left exactly alone.
  • Minify again when you need it back on one line.

Your XML

Tab indents · Esc then Tab to leave1 line

Formatted

1 line
  • 70 tools

    Free, with no account and no watermark

  • 0 bytes

    Of your files or text uploaded — this tool runs in the tab

  • No queue

    The work happens in this tab, not in a line behind other users

Three steps, nothing to install

XML Beautifier in three steps

  1. XML123456Paste it in — it never leaves the tab

    Paste your XML

    A sitemap, a SOAP envelope, a config file or a feed.

  2. XMLXMLConverted on your own device

    Indent or minify

    Elements are indented by depth. The tokeniser knows where markup stops and content begins, so nothing inside a value is touched.

  3. Copy XML

    Copy it out

    Formatted and ready to read, review or commit.

Why use XML Beautifier

  • Whitespace is not always decoration

    Inside CDATA, an attribute value or an xml:space="preserve" element, whitespace is data. Reformatting it there corrupts the document, so those regions are passed through untouched.

  • Parsed, not pattern-matched

    The input is read with a real parser and the output is written from what it found, rather than by rewriting the text with regular expressions.

  • Your text stays in the page

    What you paste is not transmitted or stored, so an API response full of customer records, a token or an internal query never leaves your machine.

Frequently asked questions

No. Attribute values, CDATA sections and anything inside xml:space="preserve" are copied through untouched, and only whitespace between elements is altered. Formatting then minifying returns the document you started with.

Reading XML that arrived as one line

XML from an API, a SOAP envelope, an RSS feed or a build artefact usually comes with every line break stripped. The structure is all still there, just invisible. Re-indenting it makes the nesting legible again, which is normally the whole reason you opened the file.

The parts that must not be touched

Formatting XML looks like a whitespace problem and is really a parsing problem. Three regions carry meaning that reindenting would destroy:

  • Attribute values — <a title="x > y"> contains a > that does not end the tag.
  • CDATA sections — everything between <![CDATA[ and ]]> is literal, including markup and spacing.
  • xml:space="preserve" — an explicit instruction that whitespace inside this element is content, not layout.

This tool tokenises the document before touching it, so all three survive. A formatter built on regular expressions typically mangles at least one.

Mixed content and minification

Minifying removes whitespace between tags, but not whitespace beside text. In <p>Hello <b>there</b></p> that space is part of the sentence; deleting it would render “Hellothere”. Distinguishing the two cases is the difference between a minifier you can trust on documents and one that only works on machine-generated data.

To turn XML into JSON, use XML to JSON, and for the reverse JSON to XML. For a sitemap specifically the XML sitemap generator produces the exact format search engines expect. For HTML rather than XML, use the HTML beautifier.

  • XML to JSON

    Convert XML documents into readable JSON.

  • JSON to XML

    Convert JSON structures into equivalent XML markup.

  • HTML Beautifier

    Re-indent minified or messy HTML into readable markup.

  • Regex Tester

    Test regular expressions live with match highlighting and groups.

  • SQL Formatter

    Indent and align SQL for PostgreSQL, MySQL, SQLite, BigQuery, Snowflake and SQL Server, with keywords capitalised.

  • YAML Validator

    Validate YAML syntax and preview the parsed result as JSON.

More tools

70 tools, none of which want your file

Everything this tool does happens in the page you are looking at. No account, no upload, no watermark.