Skip to content
epitometool

XML formatter

Code formatters

Beautify, minify and validate XML documents.

Updated

Input

Options

Output

<?xml version="1.0" encoding="UTF-8"?>
<catalog>
  <book id="bk101">
    <author>Gambardella, Matthew</author>
    <title>XML Developer's Guide</title>
    <price>44.95</price>
  </book>
  <book id="bk102">
    <author>Ralls, Kim</author>
    <title>Midnight Rain</title>
  </book>
</catalog>

Quick start

How to pretty-print or minify XML

Paste XML, choose pretty or minify, copy the result. Runs entirely in your browser.

  1. Step 1
    Paste XML

    Drop your XML payload — SOAP, RSS, SVG, config files — into the textarea.

  2. Step 2
    Pick mode

    Pretty print for readability with configurable indent, or minify to strip inter-tag whitespace for compact transport.

  3. Step 3
    Copy result

    Click Copy to grab the formatted output.

In-depth guide

XML formatter — pretty-print and minify in the browser

Paste XML and toggle between human-readable indented output and compact minified form. Handles SOAP envelopes, RSS feeds, configuration files, SVG and any other XML dialect. Everything runs locally; CDATA, comments and processing instructions are preserved.

When to pretty-print, when to minify

  • Pretty for debugging — reading server responses, diffing config files, code review.
  • Minify for transport — embedding XML in JSON, fitting under URL limits, reducing payload size when gzip isn't available.
  • Neither for production storage — most XML tooling doesn't care about whitespace. Keep it formatted however your editor prefers.

What's preserved

  • Tag names and casing.
  • Attribute names, values, order and quote style.
  • Comments (<!-- … -->) and processing instructions (<?…?>).
  • CDATA sections — their contents are not parsed or escaped.
  • DOCTYPE declarations.

Limits

  • Not a validator — won't catch unclosed or mismatched tags. Use a proper XML parser for validation.
  • Mixed text + child elements in the same parent ("mixed content") may not always indent ideally — XML's whitespace-significance rules conflict with pretty-printing.
  • Very large documents (10MB+) may slow the browser; chunk before pasting.

Pretty-printing XML

When to reach for it. Use it to indent and inspect XML, SVG or RSS so the structure is readable at a glance.

When something else is better. It assumes well-formed input; it won’t validate against a DTD or XSD schema.

The pitfall to watch. Reformatting whitespace inside elements where whitespace is significant (some XML, and SVG text) can subtly change rendering.

Everything runs on your device. The values you enter are processed locally in this browser tab — EpitomeTool does not send your input to a server, store it, or log it. That means you can use the tool offline once the page has loaded, and refreshing the tab wipes the slate.

Frequently asked questions

Does this tool send my XML anywhere?

No. Formatting runs in your browser — safe to paste sensitive configs, SOAP envelopes or RSS feeds without leaking them.

Is this a full XML parser?

No — it's a structural pretty-printer. It tokenises tags, comments, CDATA, doctypes and declarations, then re-indents. Malformed XML may produce odd output but won't error.

Does it preserve CDATA sections and comments?

Yes — comments, CDATA blocks, processing instructions and DOCTYPE declarations are kept verbatim, just re-indented.

What about attribute order and quoting?

Attributes are preserved exactly as written, including their quote style and order. We don't normalise <code>'</code> to <code>"</code> or reorder for sorting.

How does minify mode differ from pretty?

Minify strips whitespace between tags and collapses runs of whitespace inside text content. Useful for embedding XML into a JSON payload or shrinking before transmission.

Will it close unclosed tags?

No — this is a layout tool, not a healer. If your XML is malformed, fix it in your editor or a real parser first.

Keep exploring

More tools you'll like

Hand-picked utilities that pair well with the one you're on — all free, client-side, and zero-signup.