LFUnminify, online code unminifier by Ludovic Frank
EN

Unminify XML online

Format XML that arrived as a single line. Elements are indented by depth, attributes are laid out readably, and the document structure becomes visible again.

Your unminified, beautified code will appear here

XML is generated, not written

Most of the XML you meet was produced by a machine for another machine, which is why it so often arrives with no line breaks at all. Sitemaps generated by a CMS, RSS and Atom feeds, SVG files exported from a design tool, SOAP envelopes, Maven and Android configuration files, office document internals: all of them are valid, all of them are compact, and none of them were written with a human reader in mind.

What indentation reveals

XML nests deeply, and depth is exactly what a single line hides. Once the document is indented, the hierarchy becomes obvious: which elements repeat, how many children each node has, where an unexpected namespace was declared, and which tag was never closed. For a sitemap that means seeing your URL entries and their alternate language links as clean blocks. For an SVG it means finding the path or group you actually want to edit.

Namespaces, CDATA and comments

The formatter preserves what makes XML XML. Namespace prefixes and declarations stay attached to the elements they belong to, CDATA sections are kept verbatim so their contents are not reinterpreted, processing instructions and the XML declaration remain at the top, and comments that survived are laid out with the rest of the document. Attribute order is preserved as well, since in XML that order is sometimes meaningful to the tool that produced the file.

A quick way to spot a malformed document

Formatting doubles as a sanity check. If a document is well formed, it indents cleanly and the closing tags line up with their openers. If it is not, the problem tends to jump out of the formatted output far faster than it would from a validator message, because you can see the exact point where the nesting stops making sense.

Frequently asked questions

Does it work on SVG files?

Yes. SVG is XML, so an exported icon that came out as one long line will be indented into a readable tree, which makes finding a specific path, group or gradient much easier.

Can I format an RSS feed or a sitemap?

Yes, both are standard uses. Load the feed or sitemap by URL and each item or url entry becomes a clearly separated block you can scan.

Is my XML validated?

The formatter needs the document to be well formed in order to parse it, so a structural error will surface as a formatting error. It does not check the document against a schema or DTD.

Unminify another format