To validate an XML sitemap, check that it is well-formed XML, that its root is <urlset> or <sitemapindex> in the sitemaps.org namespace, and that every entry has an absolute <loc> plus valid <lastmod>, <changefreq> and <priority> values within the protocol's limits. FindUtils XML Sitemap Validator runs all of those checks in your browser and reports every issue with a severity, a rule name and its line number. It checks the text you paste and fetches nothing.

This guide covers the rules the protocol sets, what the validator checks, a worked example, and what a valid sitemap still does not guarantee.

Why Validate a Sitemap?

A sitemap is read by software, and small mistakes make parts of it unreadable:

  • An unescaped & in a URL with query parameters breaks the XML.
  • A relative URL such as /about is not allowed; the protocol and Google both ask for absolute URLs.
  • A date in the wrong format, such as 01/09/2026, is not a valid <lastmod>.
  • A generator bug can produce duplicate URLs, URLs from another host, or more than 50,000 entries in one file.

A browser shows most of these files without complaint, which is why they ship.

The Protocol's Rules and Limits

These come from the sitemaps.org protocol:

RuleLimit or format
URLs per sitemapAt most 50,000
File sizeAt most 50 MB uncompressed
Sitemap indexThe same limits; up to 50,000 sitemaps
<loc>Absolute URL, less than 2,048 characters
EncodingUTF-8, with &, <, >, " and ' escaped as entities
<lastmod>W3C Datetime; the time may be left out (YYYY-MM-DD)
<changefreq>always, hourly, daily, weekly, monthly, yearly or never
<priority>0.0 to 1.0; the default is 0.5
HostsAll URLs in one file from a single host

What Does Google Actually Use?

Google's sitemap documentation states that "Google ignores <priority> and <changefreq> values" and that it uses <lastmod> "if it's consistently and verifiably" accurate. So a wrong <priority> is still a protocol error worth fixing, but tuning priorities will not change how Google crawls. An accurate <lastmod> is the optional field worth maintaining.

How to Validate a Sitemap

Step 1: Paste the XML

Open XML Sitemap Validator and paste the sitemap or sitemap index. Use the uncompressed XML: a .xml.gz file must be unzipped first.

Step 2: Read the summary

The summary shows the type (urlset or sitemapindex), the number of entries, the hosts found, and the count of errors and warnings. The sitemap is valid when there are no errors.

Step 3: Fix issues by line

Each issue names its rule, its line and, where there is one, the URL. Errors break the protocol; warnings are worth a look but do not make the file invalid.

Step 4: Validate again

Fix the source, not just the file: if a generator wrote the mistake, it will write it again next time.

A Worked Example

XML
1
2
3
4
5
6
7
<?xml version="1.0" encoding="UTF-8"?>
<class="text-rose-400">urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<class="text-rose-400">url><class="text-rose-400">loc>https://example.com/</class="text-rose-400">loc><class="text-rose-400">lastmod>2026-09-01</class="text-rose-400">lastmod></class="text-rose-400">url>
<class="text-rose-400">url><class="text-rose-400">loc>https://example.com/search?q=a&b=2</class="text-rose-400">loc></class="text-rose-400">url>
<class="text-rose-400">url><class="text-rose-400">loc>https://example.com/about</class="text-rose-400">loc><class="text-rose-400">lastmod>01/09/2026</class="text-rose-400">lastmod><class="text-rose-400">priority>1.5</class="text-rose-400">priority></class="text-rose-400">url>
<class="text-rose-400">url><class="text-rose-400">loc>https://example.com/</class="text-rose-400">loc></class="text-rose-400">url>
</class="text-rose-400">urlset>

The validator reports 4 URLs, 3 errors and 1 warning, and marks the file invalid:

LineSeverityRuleMessage
4Errorloc-unescaped-ampersandUnescaped "&" in <loc>; write it as &amp;
5Errorlastmod-format"01/09/2026" is not a W3C datetime
5Errorpriority-range"1.5" must be a number from 0.0 to 1.0
6Warningduplicate-locDuplicate <loc>; first listed on line 3

The fixes: write https://example.com/search?q=a&amp;b=2, write the date as 2026-09-01, set the priority to 1.0 or remove it, and delete the repeated homepage entry.

Everything the Validator Checks

CheckSeverity
XML is not well-formed (stops at the first problem, with its line)Error
Root is neither <urlset> nor <sitemapindex>Error
Namespace missing or not http://www.sitemaps.org/schemas/sitemap/0.9Warning
An entry with no <loc>, or an empty <loc>Error
<loc> not an absolute http(s) URL, containing whitespace, holding a bare &, or longer than 2,048 charactersError
Duplicate <loc>Warning
URLs on more than one hostWarning, once
<lastmod> not a W3C datetimeError
<lastmod> more than a day in the futureWarning
<changefreq> not one of the seven valuesError
<priority> outside 0.0 to 1.0Error
More than 50,000 entriesError
An element other than <url> or <sitemap> directly inside the rootWarning

Valid <lastmod> forms are 2026, 2026-09, 2026-09-01, and a date with a time and a timezone, such as 2026-09-01T10:00:00+02:00 or 2026-09-01T10:00Z. A time with no timezone, like 2026-09-01T10:00:00, is an error. Impossible dates such as 2026-02-29 are errors too.

Image, video, news and xhtml:link extensions in their own namespaces are skipped, not flagged.

Limits of the Check

  • It reads up to 10 MB of XML. The protocol allows 50 MB; validate a larger file in parts.
  • It does not fetch the URLs. A <loc> is checked for shape, not for a 200 response, a redirect or a noindex.
  • It does not follow a sitemap index. Each child sitemap has to be validated on its own.
  • It does not check robots.txt. A URL listed in the sitemap but blocked in robots.txt is a contradiction; test those paths with robots.txt Tester.
  • Valid is not indexed. A clean sitemap helps discovery; it does not make a search engine index a page.

Common Mistakes

Escaping in the CMS, not in the XML. A URL with & must be written &amp; inside the file, even though the real URL has a plain &.

Listing URLs that redirect or are blocked. List the final, canonical URL that returns 200 and is allowed to be crawled.

Setting every lastmod to today. Google uses <lastmod> only when it is consistently and verifiably accurate; a date that changes on every build while the page stays the same is not accurate.

Mixing hosts. www.example.com and example.com are different hosts. Pick one.

Use It From Code

The validator is the sitemap_validator tool on the FindUtils REST API and MCP server. Text sent there is processed on the server rather than in your browser.

1
2
3
curl -X POST https://api.findutils.com/api/tools/sitemap-validator/execute \
  -H "Content-Type: application/json" \
  -d '{"xml":"<urlset xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\"><url><loc>/about</loc></url></urlset>"}'

That returns valid: false with one loc-not-absolute error on line 1. The response also carries type, url_count, hosts, issues (up to 1,000) and the first 1,000 urls. See the API reference and the MCP reference.

Tools Used in This Guide

ToolUse
XML Sitemap ValidatorCheck a sitemap or sitemap index against the protocol
XML Sitemap GeneratorBuild a sitemap from a list of URLs
robots.txt TesterCheck that sitemap URLs are not blocked
Robots.txt GeneratorAdd the Sitemap line to a new robots.txt

FAQ

How many URLs can a sitemap have?

At most 50,000 URLs and 50 MB uncompressed per file. For more, split the URLs into several sitemaps and list them in a sitemap index.

What date format does lastmod use?

W3C Datetime: YYYY-MM-DD, or a full date and time with a timezone, such as 2026-09-01T10:00:00+02:00.

Does Google use changefreq and priority?

No. Google's documentation states that it ignores both. It uses <lastmod> when the dates are consistently accurate.

Does the validator check that my URLs work?

No. It checks the XML and the shape of each URL but fetches nothing, so a URL that returns 404 is not detected.

Can it validate a gzipped sitemap?

Not directly. Unzip the .xml.gz file and paste the XML.

Next Steps

Check your file with XML Sitemap Validator. To build one from scratch, use the XML Sitemap Generator and read its guide.