XML minifier

Paste XML to strip the indentation and line breaks between tags. Whitespace inside text, mixed content and xml:space="preserve" elements is kept, so the data does not change. The XML is checked first.

Open a file: (or drop it on this box)


Only the whitespace between tags changes

Many formatters parse XML into a DOM and print it back, which quietly rewrites the document: entities like ' come back as ', CDATA sections turn into escaped text, single-quoted attributes become double-quoted, and some tools trim or re-wrap text. This one works on the original characters. It moves elements onto their own lines and indents them, and copies everything else as written:

Errors it explains

XML parsers stop at the first well-formedness error, and their messages (mismatched tag, not well-formed (invalid token), EntityRef: expecting ';') rarely say what to change. Here each error gives the line and column, shows the line with a caret, and names the fix. The usual causes:

Well-formed is not the same as valid against a schema: this checks the syntax every XML parser requires, not an XSD or DTD.

Turn XML into a PDF or an image

Need a document from XML data, like an invoice, a report or a feed snapshot? Transform it to HTML (XSLT or your own template) and the Shotmint API renders it in real Chromium: POST https://shotmint.creasework.com/v1/pdf with {"html": "…"} returns a PDF and /v1/screenshot returns a PNG of any page or HTML (1 credit each; 25 free renders a month, then €5 for 2,000 that never expire). Scripts, AI agents and Make or Zapier can get a key with a bare POST https://shotmint.creasework.com/v1/keys/free (no body, JSON reply); the request bodies are described in openapi.json.

Get 25 free renders a month API docs

FAQ

Is my XML uploaded? No. Checking and formatting run in your browser; this page sends nothing to a server, so it is safe for config files, SOAP messages and exports with personal data.

Does it check namespaces or a schema? No. It checks well-formedness (the rules of XML 1.0 itself). Undefined entities are accepted when the file has a DOCTYPE, since the DTD may declare them.

Related tools: XML formatter, XML validator, XML to JSON, JSON to XML, JSON formatter, YAML to JSON.

Related tools

Minify JSON · JSON to XML · XML to JSON · XML formatter · XML Validator · all free tools