b2KIT

Sitemap XML Validator

Validate XML sitemap files against the sitemap protocol schema with error reporting and URL count display.

Tested tool guide Tested browser tools Checked August 16, 2026

What Sitemap XML Validator does, with a checked example

Paste the contents of a sitemap file and this tool checks it against the Sitemaps 0.9 protocol, the format search engines expect. It verifies the XML is well formed, that the root element is a urlset in the sitemaps namespace, and that each url entry follows the rules: a required absolute loc, a W3C-format lastmod, a changefreq from the seven allowed values, and a priority between 0.0 and 1.0. Violations are reported with their position, and the tool displays the total URL count. The surprise is that well-formed XML is not automatically a valid sitemap: a missing xmlns, a relative loc, or a misspelled changefreq all fail, and a clean result says nothing about whether Google will index anything.

Worked example

A concrete input and expected output from the current implementation.

Input

<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
  <url>
    <loc>https://example.com/</loc>
    <changefreq>weekly</changefreq>
  </url>
  <url>
    <loc>https://example.com/about</loc>
    <changefreq>sometimes</changefreq>
  </url>
</urlset>

Expected output

Valid: no (1 error)
URLs found: 2

url #2 (https://example.com/about):
  <changefreq> "sometimes" is not allowed.
  Allowed values: always, hourly, daily, weekly, monthly, yearly, never

Entry 1 passes because weekly is one of the seven allowed changefreq values. Entry 2 fails even though the XML is well formed, because changefreq is restricted to those values - the classic case of a file that parses as XML but violates the sitemap rules.

How the result is produced

1

Two-stage parse

The document is parsed as XML before any sitemap rule applies. Syntax failures - unclosed tags, stray ampersands, illegal byte sequences - are reported as XML errors, not sitemap errors. Only a well-formed document is checked against the protocol: the root element must be urlset (or sitemapindex for an index file) in the http://www.sitemaps.org/schemas/sitemap/0.9 namespace, and entries must carry that namespace.

2

Per-URL rules and counting

Each url element is checked in isolation: exactly one loc holding an absolute URL, an optional lastmod in W3C datetime form, an optional changefreq limited to always, hourly, daily, weekly, monthly, yearly, never, and an optional priority in the range 0.0 to 1.0. Errors are attached to the offending entry's position, and the URL count reflects the url elements found, so an invalid file still reports how many entries it contains.

Good uses

  • After a CMS, plugin, or build script regenerates your sitemap, before resubmitting it to Google Search Console or Bing Webmaster Tools - a malformed regeneration silently wastes the submission and the search console returns no useful error.
  • Pre-launch QA for a new site: run the generated sitemap through the validator to catch relative URLs, missing loc elements, or lastmod values your tooling emitted in a format the protocol does not allow.
  • When a submitted sitemap appears to be ignored, rule out format problems first so debugging can focus on crawl-time causes such as robots.txt, redirect chains, or noindex pages.

Limits and checks

  • Conformance, not reachability. A zero-error result does not mean the URLs work: entries can still 404, redirect, or be blocked by robots.txt or noindex. The validator reads only the pasted file and never fetches the URLs it lists.
  • The URL count is entries in the file, not indexed pages. Google decides what to crawl and index, so treat the displayed count as an upper bound; Search Console's coverage report will typically show fewer.
  • Some common problems are not protocol violations and may pass: duplicate loc values, mixed http/https variants of the same page, or lastmod dates that are well formed but factually wrong. Use this tool as the protocol gate, not a full SEO audit.

Common questions

The validator says my sitemap is fine, but Google still shows no indexed pages.

Passing validation only means the file follows the protocol; it cannot promise indexing. Google indexes based on crawlability, content, and its own evaluation, and a new site can take days or weeks to appear. A clean result lets you rule out format problems and move on to robots.txt, internal links, and Search Console's coverage report.

Why does the tool complain about the namespace when my file looks correct?

Most likely the root element is missing its xmlns attribute or has a typo. It must read exactly xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" on the urlset element. Also confirm the file is actually XML: an HTML page renamed or served as sitemap.xml fails before any sitemap rule is checked.

References and verification

The example and behavioral notes were checked against the browser implementation. Standards and primary references below define the relevant format, formula, or platform behavior.

Related Tools