Clean Indentation
Nested elements get consistent, readable indentation so the structure is easy to follow.
Format messy XML with clean indentation, or minify it, right in your browser. Checks that the XML is well formed and shows it with syntax highlighting. Free, no signup, nothing uploaded.
Drop in your XML, or upload a .xml file. It checks that the markup is well formed and formats it right away.
Choose Format for clean indentation, or Minify to strip it to a single compact line. Set the indent size when formatting.
Copy the result or download it as a .xml file, ready to use in your project.
XML turns up everywhere, in config files, RSS feeds, SVG graphics, API responses, and data exports. When it arrives on one long line with no spacing, working out which element sits inside which becomes guesswork, and a single misplaced tag can be hard to spot.
This formatter rebuilds the markup with clean, consistent indentation so the nesting is obvious. It handles the XML declaration, comments, and CDATA sections correctly, keeping the content inside them exactly as it was while tidying everything around it.
It also checks that the XML is well formed before you trust it. If a tag is unclosed or a quote is missing, you get a clear message instead of a silent problem later. Switch to minify when you need a compact version for production, pick your indent size, and copy the result. It all runs in the browser, so private files stay on your machine.
Nested elements get consistent, readable indentation so the structure is easy to follow.
Tells you instantly whether your XML is well formed, and points out the error if it is not.
Beautify tangled XML, or minify it to one line to shrink the file for transport.
Content inside CDATA sections and comments is preserved exactly, so nothing gets altered.
Tags, attributes, values, and CDATA are colored so the output is easy to read at a glance.
Your XML is processed on your device. Nothing is uploaded, logged, or stored.
More Developer tools you might find useful.
Common questions about formatting XML.