XML formatter and validator

Paste XML from an API response, a config file, a sitemap or an export and get readable, properly indented XML, or find the exact place where it is broken.

Private: works in your browser, nothing is uploaded.

How to use the XML Formatter tool

  1. Paste your XML into the left box.
  2. Choose the indentation.
  3. Click “Format”, “Minify” or “Validate”.
  4. Copy the result or download it as a file.

Well-formed XML in one click

The check uses your browser’s own XML parser, the same strict rules every XML program follows: one root element, every tag closed, attributes in quotes, special characters escaped. If something is wrong, you see the error with line and column, so you can fix it in the original file.

Common XML errors

  • An unescaped & in text or a URL: write & instead.
  • A missing closing tag or tags closed in the wrong order.
  • Two root elements: everything must sit inside one outer element.
  • Text before the XML declaration, such as a stray space or a byte order mark.

What formatting keeps

Elements, attributes, text, comments, CDATA sections and the XML declaration are kept. Whitespace between tags is replaced by clean indentation; whitespace inside text is trimmed at the start and end. Validation against a schema (XSD or DTD) is not included.

Privacy

Everything runs in your browser. Your text is not sent to our server or stored anywhere.

Where you meet XML today

  • SOAP and older enterprise APIs, bank and payment files (ISO 20022), e-invoices.
  • Sitemaps, RSS and Atom feeds.
  • Office files: .docx and .xlsx are ZIP archives full of XML.
  • Configuration of Java applications, Maven (pom.xml), Android layouts and .NET projects.

Formatting before comparing

Two XML files that differ only in whitespace look completely different in a diff tool. Format both with the same indentation first, then compare them with the Diff Checker to see only the real changes.

Frequently asked questions

Is my XML uploaded?

No. It is parsed and formatted in your browser and never leaves your device.

Can it format HTML?

Only HTML that is valid XML (XHTML). Normal HTML is more forgiving, so an XML parser rejects many real web pages.

How big can the file be?

Several megabytes work fine. Very large files may take a few seconds.

Can I convert XML to JSON?

Yes, with the XML to JSON converter.

Does minifying change the data?

No. Minify removes whitespace between tags only. Elements, attributes and text stay the same.

Can it check my XML against a schema?

It checks that the XML is well-formed. Validation against XSD or DTD needs a dedicated validator or your IDE.