Skip to content

XML Formatter / Validator

Format, validate, and pretty-print XML documents.

Input

Drop file here or click to browse

Maximum 5 MB (.xml,.xsd,.svg,.txt)

Output

About the XML Formatter / Validator

Format and validate XML documents with proper indentation and clear error reporting. XML still underpins SOAP services, RSS feeds, Android layouts, Maven builds, and countless enterprise integrations, and a single unclosed tag can be almost impossible to spot in a minified document.

How to use it

  1. 1 Paste your XML, or drop in an .xml file.
  2. 2 Click Format to indent the document hierarchy readably.
  3. 3 Use Minify to strip whitespace for transmission.
  4. 4 Any parse error is reported with its location so you can find the broken tag.

What it does

  • Pretty-print with nested indentation
  • Minify for smaller payloads
  • Well-formedness validation with error positions
  • Attribute and namespace preservation

Frequently asked questions

Is my XML uploaded?

No. Every calculation happens locally in your browser using JavaScript. Nothing you paste is uploaded, logged, or stored on a server, which makes the tool safe to use with production data, credentials, and customer records.

What makes an XML document "well-formed"?

Every opening tag has a matching close, tags nest without overlapping, there is exactly one root element, attribute values are quoted, and the reserved characters < and & are escaped. Well-formed is a lower bar than valid — validity additionally requires conformance to a DTD or schema.

What is the difference between XML and JSON?

XML carries markup semantics — attributes, namespaces, comments, and schema validation — which suits document-oriented and enterprise data. JSON maps directly onto the data structures of most programming languages and is far less verbose, which is why it dominates web APIs. Neither replaces the other outright.

How do I escape special characters in XML?

Five characters have entity forms: & becomes &amp;, < becomes &lt;, > becomes &gt;, " becomes &quot;, and ' becomes &apos;. Escaping & and < is mandatory in text content. For larger blocks of arbitrary text, wrap it in a CDATA section instead.