Overview
Introduction
A sitemap.xml file is one of the simplest ways to tell search engines about every URL on a site, but the XML format leaves plenty of room for silent mistakes: a malformed date in <lastmod>, a relative instead of absolute <loc>, or a sitemap that's quietly grown past the protocol's 50,000-URL limit without anyone noticing.
This tool fetches a sitemap (or reads pasted XML) and checks it against the sitemaps.org protocol directly, catching both outright parsing failures and the smaller structural issues that don't break XML parsing but still violate the spec.
What Is XML Sitemap Validator?
A sitemap.xml and sitemap-index validator that checks the document against the sitemaps.org protocol: correct root element, required <loc> per entry, properly formatted <lastmod> dates, in-range <priority> values, and valid <changefreq> keywords.
It handles both sitemap types: a regular <urlset> file listing pages directly, and a <sitemapindex> file listing other sitemap files, auto-detecting which one you've provided from its root element.
How XML Sitemap Validator Works
The XML is parsed with the browser's own DOMParser in strict XML mode, which surfaces genuine parsing failures (unclosed tags, invalid characters) immediately as an error rather than trying to recover from them.
Once parsed, every <url> or <sitemap> entry is checked individually: <loc> must be present and an absolute http(s) URL, <lastmod> (if present) must match YYYY-MM-DD or full ISO 8601, <priority> (if present) must fall between 0.0 and 1.0, and <changefreq> (if present) must be one of the seven values the protocol defines. The total entry count and raw byte size are also checked against the protocol's hard limits.
When To Use XML Sitemap Validator
After generating or updating a sitemap via a CMS plugin or build script, to confirm the output is actually valid before submitting it to Search Console.
When a sitemap submission in Search Console reports errors, to narrow down which specific entries are malformed rather than guessing from a vague dashboard message.
Often used alongside XML Sitemap Generator and Meta Tag Checker.
Features
Advantages
- Checks the protocol's two hard numeric limits (URL count and file size) that are easy to blow past silently as a site grows, and that most basic XML validators don't know to look for.
- Distinguishes real errors (a missing or malformed <loc>) from soft-guidance issues (an odd <priority> value), so you know what actually needs fixing.
- Works on any sitemap via the paste fallback, not just ones that happen to allow cross-origin fetches.
Limitations
- This validates the XML structure and protocol rules but can't confirm the URLs listed actually exist or return a 200 status; pair it with a link checker for that.
- A live fetch only works when the target site sends permissive CORS headers, which most ordinary websites don't; use the paste fallback for anything else.
Examples
Best Practices & Notes
Best Practices
- Split any sitemap approaching 50,000 URLs or 50MB uncompressed into multiple files referenced from a sitemap index, well before hitting the hard limit.
- Use full ISO 8601 or plain YYYY-MM-DD dates for <lastmod>, and only update it when the page's content actually changed, since search engines use it as a freshness signal.
- Validate a generated sitemap right after any CMS or build-script change that touches sitemap generation, since a template bug can silently corrupt every entry at once.
Developer Notes
Validation uses application/xml parsing mode (strict), not text/html mode, so malformed XML that a lenient HTML parser might silently patch over is correctly reported as a parsing failure here.
XML Sitemap Validator Use Cases
- Validating a sitemap generated by a CMS plugin or static site generator before submitting it to Search Console
- Diagnosing which specific entries are causing a sitemap submission error reported in Search Console
- Confirming a growing site's sitemap hasn't quietly exceeded the 50,000 URL protocol limit
Common Mistakes
- Listing relative paths instead of fully qualified absolute URLs in <loc>, which the protocol requires and most search engines reject or ignore.
- Letting a single sitemap grow past 50,000 URLs without splitting it into a sitemap index, causing search engines to silently ignore entries beyond the limit.
Tips
- If the tool reports a parsing failure, check for an unescaped & in a URL first; it's the most common cause of broken sitemap XML (use & instead).
- A <sitemapindex> validates each nested <sitemap> entry's <loc> and <lastmod>, but doesn't recursively fetch and validate those child sitemaps; validate each one separately too.