Skip to content
FileTinker

XML Formatter

Paste XML and get it cleanly indented, or minified to a single line — and any mismatched or unclosed tags are flagged. Everything runs in your browser, so your XML is never uploaded.

The result will appear here.

How to format XML

  1. Choose Beautify to indent, or Minify to compact.
  2. Paste your XML into the input box.
  3. Copy the formatted XML — or read the error if a tag is mismatched.

About formatting XML

XML stores data in nested tags, and editors often leave it as one long line or inconsistently indented, which makes the structure hard to follow. Beautifying re-indents it so parent/child relationships are obvious; minifying removes the formatting whitespace to shrink it for transport.

A quick well-formedness check — do all tags open and close in the right order? — catches the most common XML mistakes before they reach a parser. This tool does both in your browser with no upload, so configuration files, feeds and exports stay private.

You will meet ugly XML anywhere systems exchange data: SOAP responses from legacy APIs, RSS and Atom feeds, sitemaps, invoice and e-book formats, build files and application configs. Most of it is machine-generated on one line, which is fine for software and hopeless for humans. Re-indenting before you read saves real time when you are hunting for one element inside a deep hierarchy or comparing two versions of a feed.

A few rules trip people up again and again. XML is case-sensitive, so an opening Item tag cannot be closed by an item tag. A document needs exactly one root element wrapping everything else. And a handful of characters are reserved: raw ampersands and angle brackets inside text must be written as entities like & and <. Editing XML by hand and skipping one of these is how most parse errors are born.

Frequently asked questions

How do I beautify XML?

Paste your XML in Beautify mode and it is re-indented with each element on its own line. Switch to Minify to strip the whitespace between tags instead.

Does it validate the XML?

It checks that tags are properly nested and closed, and reports the first mismatched or unclosed tag. It is a well-formedness check, not full schema (DTD/XSD) validation.

Will it handle comments and CDATA?

Yes — comments, CDATA sections, processing instructions and doctype declarations are preserved.

Is my XML uploaded?

No. Formatting happens entirely in your browser; nothing is sent to a server.

When should I minify XML instead of beautifying it?

Minify when the XML is leaving for a machine — embedding in a request, a config field with size limits, or storage where every byte counts. The saving is modest if the transport already compresses with gzip, so do not sacrifice readability for files humans maintain. A common pattern is keeping the beautified version as your working copy and minifying only the copy you ship.