XML Formatter

Format and validate XML with proper indentation, error detection and element statistics.

or drag & drop a file here (.xml, .rss, .atom, .svg, .kml, .gpx, .xsd, .xsl, .xslt, .wsdl, .plist, .config, .xliff, .xlf). Read in your browser, never uploaded.

Website Management Tools

About the XML Formatter

The XML Formatter tidies XML with proper indentation and checks whether it is valid. Paste your code, upload a file, or load one from a web address. If there is an error, it shows the line and the exact position, so you can fix it quickly.

It recognises sitemaps, RSS feeds, Atom feeds and SVG files, and warns you about some common sitemap problems, such as a missing namespace. It also reports the number of elements, attributes and comments, the maximum depth, and the size before and after.

You can beautify the code for reading, or minify it to make the file smaller, and you can choose to keep or remove comments. The formatter is a good way to check a sitemap before you submit it to Google Search Console.

How to use this tool

  1. 1Paste XML, upload a file or load it from a URL.
  2. 2Choose formatted or minified output, and the indent size.
  3. 3Fix any errors shown with their line numbers.
  4. 4Copy or download the result.

Best-practice tips

  • Every opening tag needs a matching closing tag, and capitals must match.
  • Replace a plain & with & in your XML, which is one of the most common errors.
  • Check your sitemap here after any big site change.

Answers

XML Formatter FAQs

They mean the same thing: adding indentation and line breaks so that the code is easier to read.

Related tools

Continue with these related website management tools.