Webmaster Bench

Tools / XML Sitemap Validator

XML Sitemap Validator

Paste or open a sitemap.xml or sitemap index. Every entry is checked against the sitemaps.org protocol and Google's documented limits, with the entry number for each problem.

Build a sitemap from a list of URLs

What it checks

  • Well-formed XML. One unescaped & or a stray character makes the whole file unreadable to search engines, not just one entry. The parser's message is shown, with a hint when the cause is an ampersand.
  • Root element and namespace. A sitemap is a <urlset>; an index of sitemaps is a <sitemapindex>. Both must declare xmlns="http://www.sitemaps.org/schemas/sitemap/0.9".
  • Every <loc>: present, an absolute http or https URL, at most 2,048 characters, no spaces, no #fragment, not duplicated.
  • <lastmod> in W3C Datetime format (2025-06-01 or 2025-06-01T09:30:00+00:00), real calendar dates, and not in the future.
  • <changefreq> and <priority> have legal values (Google ignores both, so the checker only notes them).
  • Limits: 50,000 URLs and 50 MB uncompressed per file.
  • Hosts: all URLs should be on the host the sitemap is served from. http vs https and www vs bare domain count as different hosts.
  • Extensions for images, video, news and hreflang (xhtml:link) are recognised.

A minimal valid sitemap

<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
  <url>
    <loc>https://www.example.com/</loc>
    <lastmod>2025-06-01</lastmod>
  </url>
  <url>
    <loc>https://www.example.com/products?id=7&amp;color=red</loc>
  </url>
</urlset>

Only <loc> is required. Note the &amp;: inside XML, the five characters & < > " ' must be written as entities. Most sitemap errors in the wild are this one.

Sitemap indexes

When a site has more than 50,000 URLs, or you want separate files per section, list the sitemaps in an index:

<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
  <sitemap><loc>https://www.example.com/sitemap-products-1.xml.gz</loc></sitemap>
  <sitemap><loc>https://www.example.com/sitemap-blog.xml</loc></sitemap>
</sitemapindex>

An index may list up to 50,000 sitemaps, but it cannot list other indexes. Sitemaps may be gzip-compressed; the 50 MB limit applies to the uncompressed size.

What matters to Google, and what does not

  • lastmod is used, but only if it is consistently accurate. Set it to the date the page's main content last changed, not the date the sitemap was generated. A sitemap where every URL has today's date teaches Google to ignore the field.
  • priority and changefreq are ignored by Google. Bing has said the same about priority.
  • Listing a URL does not guarantee indexing. A sitemap is a hint about which URLs exist and which are canonical. List only canonical, indexable URLs that return 200: no redirects, no 404s, no pages with noindex, no parameter duplicates.
  • Tell search engines where it is with a Sitemap: line in robots.txt and by submitting it in Google Search Console and Bing Webmaster Tools.

Common errors and fixes

ErrorFix
"EntityRef: expecting ';'" or similar parser errorReplace & in URLs with &amp;, or let your generator escape output.
Missing or wrong namespaceUse exactly http://www.sitemaps.org/schemas/sitemap/0.9 (http, not https).
Relative URLs such as /aboutWrite the full URL including protocol and host.
lastmod like 31/12/2025 or 2025-12-31 10:00Use 2025-12-31 or 2025-12-31T10:00:00+00:00; a time needs a time zone.
Text before <?xml (a blank line, a BOM in the wrong place, a PHP warning)The XML declaration must be the very first thing in the file.

Sources

Last reviewed 2026-11-15. Your input is processed only in your browser and never sent to us.