Free Tool · In-Browser · No Upload

XML Formatter

Beautify messy XML into a clean, indented structure — or minify it for transport — and check it is well-formed as you go, all without anything leaving your browser.

100% free no signup Zero data uploaded No ads or trackers
Mode
Indent
Input
Output
Try an example:
Recent on this device

Nothing saved yet. Your recent inputs appear here — stored only in this browser, never uploaded.

Your data never leaves your browser

This tool runs entirely in your browser. There is no upload endpoint on this page — your input is processed locally with native browser APIs, and nothing is sent to a server or logged. Open your browser's network panel and check: the only request is the page itself.

How it works

Three steps, no surprises

1

Paste your XML

Drop in a config file, an RSS feed, an SVG, a SOAP message — anything XML. It is parsed the moment you paste.

2

Beautify or minify

Re-indent with 2 spaces, 4 spaces or a tab to read and edit it, or minify to shrink it for transport. If it is not well-formed, you get the exact line and column.

3

Copy, download or share

Copy the result, download it as a file, or grab a share link that carries your input in the URL — never on a server.

FAQ

XML Formatter questions, answered

What does this XML formatter do?

It does three things in your browser. Beautify re-indents your XML so the structure is easy to read, with each element on its own line. Minify strips the whitespace between elements to make the document as small as possible. And as it works it checks that the XML is well-formed, pointing you to the line and column of the first problem if there is one. It is handy for tidying config files, RSS feeds, SVGs, SOAP messages and any other XML you are working with.

Does it check my XML against a schema (DTD or XSD)?

No — it checks that your XML is well-formed, which is a different and more basic thing. Well-formed means the syntax is correct: every tag is closed, tags are properly nested, attribute values are quoted, and special characters are escaped. It does not check your document against a DTD or XSD, so it will not tell you whether a particular element is allowed in a particular place. For that you need a validating parser with your schema. This tool catches the syntax errors that break parsers in the first place.

Why does my XML fail with a “line X, column Y” error?

That points to where the parser first could not make sense of the document. The usual culprits are a tag that is never closed or is closed with the wrong name, an unescaped & or < inside text (they must be written &amp; and &lt;), more than one root element, or a stray character before the XML declaration. Jump to the line and column shown and the problem is almost always right there or just above it.

Will beautifying change my data?

It only changes the whitespace that sits between elements — the part that is there purely for layout. The text inside your elements, CDATA sections, comments and attribute values are all left exactly as they are. Elements that contain a mix of text and child elements are kept on a single line so their spacing is never altered, because in those cases the whitespace can be meaningful. In short, beautify reformats the structure without touching the content.

When should I minify instead of beautify?

Beautify is for humans — reviewing, editing or debugging XML. Minify is for machines and transport: shrinking a feed, a config payload or a SOAP request before sending it over the wire or storing it. The two are reversible in the sense that minified XML can be beautified again, since only the layout whitespace differs. Use beautify while you work and minify when you ship.

Is my XML uploaded anywhere?

No. Parsing, formatting and validation all run locally with your browser’s built-in XML parser — nothing you paste is sent to a server, which you can confirm in the network panel. The optional share link stores the XML in the URL itself rather than on a server, and the on-device history can be cleared whenever you like. Your data stays on your machine.

Need help with your website's SEO?

Book a free consultation with our London team.

Book a Free Consultation