XML Formatter

Make XML readable and check that it is well formed. It runs in your browser.

Your files stay with you. Your files never leave your browser. This tool runs on your device: nothing is uploaded to our servers, so there is nothing for us to store or see.

How to use it

  1. Paste your XML or open a .xml file.
  2. Choose the indentation, or Minified.
  3. Copy or download the result.

Where it helps

SOAP and APIs

Read a SOAP response or e-invoice payload at a glance.

Sitemaps and feeds

Check a sitemap or RSS feed before submitting it.

Finding errors

Find the unclosed or mismatched tag that breaks a parser.

Good to know

  • Stays in your browser

    Your text is processed on your device and never sent to our servers.

  • Whitespace in text

    Runs of spaces in text are collapsed when formatting.

  • Namespaces accepted

    Prefixed tags like soap:Body are fine.

Questions people ask

How do you format XML and check that it's well formed?

Paste your XML or open a .xml file and choose an indentation or Minified. The tool re-indents the XML and checks it's well formed: tags closed in the right order, one root element, quoted attributes and closed comments and CDATA. It doesn't validate against an XSD or DTD.

  • Pretty Or minified. Your choice.
  • Well formed Checked. Tags, root, quotes.
  • SOAP RSS, sitemaps. Ordinary XML.
  • No XSD Schema checks. Not included.
What does the validator check?
That the XML is well formed: tags open and close in the right order, there's a single root element, attributes are quoted, and comments and CDATA sections are closed. It doesn't check the content against an XSD or DTD schema, so a well-formed file can still be rejected by a strict system.
Does formatting change my data?
Whitespace between elements is re-indented, and runs of spaces inside text are collapsed. Element names, attributes and values stay the same. Content that depends on exact whitespace, such as preformatted text, shouldn't be reformatted, so keep the original file for that. Minified output keeps text content the same way.
Can it handle SOAP, RSS and sitemap files?
Yes, they're ordinary XML. Namespaces in tag names, such as soap:Body or xhtml:link, are accepted. Paste a sitemap to check it's well formed before submitting it in Search Console, or a SOAP response to read the fields you need without scrolling through one line. Large sitemaps may take a second.
Is my XML uploaded?
No. Your text is processed in your browser and never sent to our servers, and nothing is stored when you close the page. That keeps invoices, API payloads and internal data private. As a habit, avoid pasting live credentials into any web tool on a shared computer.
Why is my XML not well formed?
The most common causes are a tag that isn't closed, tags closed in the wrong order, an unescaped & in text, an attribute without quotes, or two root elements. The error points to where the parser gave up. Fix that spot and format again to find any further problem.
How do I escape special characters in XML?
Write & as &amp;, < as &lt; and > as &gt; in text, and escape quotes inside attribute values. Or wrap a block of text in a CDATA section so it's read as is. The HTML entity encoder can escape a piece of text for you before you paste it into XML.
What is the difference between well formed and valid?
Well formed means the XML follows the basic syntax rules, which this tool checks. Valid means it also matches a schema, such as an XSD, that defines which elements and values are allowed. A system can reject well-formed XML that doesn't match its schema. Use an XSD validator for that step.
When should I minify XML?
When the file is sent over a network or stored and nobody needs to read it, such as an API request body or a large feed. Minifying removes indentation and line breaks between tags, which saves bytes. Keep a formatted copy for editing and debugging.
Can I check an e-invoice or GST JSON instead?
Indian e-invoices and many GST APIs use JSON rather than XML, so use the JSON formatter for those. This tool suits XML-based systems such as SOAP services, older bank and payment interfaces, RSS feeds and sitemaps, which are still common in Indian business software. Both tools run locally.
Does it keep comments and processing instructions?
Yes. Comments and the XML declaration at the top are kept and indented with the rest of the document. CDATA sections are kept as they are. Only the whitespace between elements and inside text runs is changed by the formatter. That keeps notes and version details in place.
How big an XML file can I format?
Files of a few megabytes format comfortably in a browser. Very large feeds or exports can slow the tab down, so format a section of the file if you only need to read part of it. For bulk processing, an XML tool on your own machine is faster.
Can I open a file from my computer?
Yes. Use the file button to open a .xml file, and it loads into the editor without being uploaded. Download the formatted or minified version when you're done, or copy it to the clipboard to paste into your code, a ticket or an email to a colleague.
Does it support XPath or transformations?
No. It formats, minifies and checks that XML is well formed. For XPath queries or XSLT transformations, use an IDE, a command-line tool or a library in your language. Formatting the file here first often makes those queries easier to write. Readable structure makes each step easier.
Does it work on a phone?
Yes. Paste XML or open a file on your phone to read it formatted. It's useful for checking a sitemap or a feed while away from your desk. Long, deeply nested documents are easier to read on a larger screen, but everything runs locally. No app is needed.
Is the XML formatter free?
Yes. It's free with no sign-up and no limit on use. It's one of the free developer tools from Marketiism, with the JSON formatter and the HTML minifier. Marketiism builds WhatsApp, billing and CRM software for small businesses. Use it as often as you need.

Want this inside your own account?

Marketiism keeps your invoice numbers, GST reports, UPI payment links and WhatsApp reminders in one place. Leave your details and we'll call to set it up for your business, or start the trial yourself.

Start free trial

We use this only to contact you about Marketiism. No spam.

More Developer tools

JSON Formatter

Format, validate and minify JSON, and see exactly which line has a mistake.

JSON to CSV

Turn a JSON list of records into CSV for Excel or Google Sheets.

CSV to JSON

Convert CSV rows into a JSON list, with numbers and true/false detected.

YAML to JSON

Convert YAML config files into JSON and catch indentation mistakes.

Try it on your own business for two weeks.

14 days free, no card. If you get stuck setting up WhatsApp, we'll get on a call and do it with you.