XML Formatter
Format and validate XML with proper indentation, error detection and element statistics.
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
- 1Paste XML, upload a file or load it from a URL.
- 2Choose formatted or minified output, and the indent size.
- 3Fix any errors shown with their line numbers.
- 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.
There is usually an unclosed tag, a mismatched tag name, or a plain & character. The error shows the line to check.
Yes. It recognises sitemaps and warns about common problems.
Related tools
Continue with these related website management tools.
Website SEO Score Checker
Get an instant SEO score out of 100 with a detailed breakdown of title, meta, headings, images, links, social tags and technical signals from the live page.
Website Ping Test
Ping any website: measure real response times from your browser and check whether the server is online, with its HTTP status and redirects.
Website Page Speed Checker
Measure real load timing for any page: response time, HTML size, code-to-text ratio, resource counts and Core Web Vitals-style recommendations.