ToolsThatRank, $99

handsofflinks / XML sitemap validator

XML sitemap validator

Paste the XML of a sitemap or a sitemap index and select Validate. The validator applies rules from the sitemaps.org protocol and from Google's sitemap documentation. It checks that the file parses as XML, the root element and its namespace, the required tags, the limits of 50,000 entries and 52,428,800 bytes, absolute URLs on one protocol and host, the lastmod date format, the loc length, and the changefreq and priority values. If you type the sitemap URL, it also checks each entry against the location of the file. The pasted XML stays in your browser.

Updated 2026-11-17

By Michael Lip. The sources on this page were read on 17 November 2026.

The sitemaps.org protocol says that URLs that are not considered valid are dropped from further consideration. Paste your file here to see which of the rules on this page it breaks before you submit it. The validator checks the rules listed below. It does not run a full XML Schema validation.

The robots.txt tester on this site checks whether a robots.txt rule blocks a URL. This page checks the sitemap file itself.

Validate a sitemap

The validator does not fetch URLs. Open your sitemap, for example https://your-site.example/sitemap.xml, in a browser tab, copy the XML and paste it below. The sitemaps.org examples start with <?xml version="1.0" encoding="UTF-8"?>.

Pasted text stays in this tab. Nothing is uploaded or fetched.

What the validator checks

Each check below comes from a published source. Each finding in the result names the check that failed.

  • XML well-formedness. The file must parse as XML. A raw & or < inside a URL breaks the parse and fails the whole file. The protocol says that data values, including URLs, must use entity escape codes for &, ', ", > and < (sitemaps.org protocol, entity escaping). The validator reports a raw & or < through the parse error. It does not flag a raw ', " or >, because these do not break the XML.
  • Root element and namespace. The root of a sitemap is urlset and the root of a sitemap index is sitemapindex, both in the namespace http://www.sitemaps.org/schemas/sitemap/0.9. The sitemaps.org XML Schema defines the elements. The validator checks the root and the namespace, not the whole schema.
  • Required tags. Every <url> entry needs a <loc>. A sitemap index needs the sitemapindex, sitemap and loc tags (Google, manage sitemaps with a sitemap index file).
  • Size limits. A sitemap must have no more than 50,000 URLs and must be no larger than 50MB (52,428,800 bytes). A sitemap index may not list more than 50,000 sitemaps and has the same size limit (sitemaps.org protocol). Google gives the same limits for all formats (Google, build and submit a sitemap).
  • Absolute, single-host URLs. Google asks for fully-qualified, absolute URLs (Google, build and submit a sitemap). The protocol says that all URLs in a sitemap must use the same protocol and reside on the same host as the sitemap, so a sitemap at http://www.example.com/sitemap.xml can't include URLs from http://subdomain.example.com (sitemaps.org protocol, file location). Without the sitemap URL, the validator compares each entry with the first entry in the file. The protocol has a cross-submit method for other hosts, a Sitemap line in the robots.txt of each host. The validator cannot see those robots.txt files, so it still flags such URLs.
  • lastmod format. The protocol asks for the W3C Datetime format and allows the date alone, as YYYY-MM-DD. The sitemaps.org schema shows the examples 2005-05-10 and 2005-05-10T17:33:30+08:00. The validator accepts a date, or a date with hours and minutes, optional seconds and a time zone, and it rejects dates that do not exist, such as 2026-02-30. Google uses the value if it is consistently and verifiably accurate, and Google ignores <priority> and <changefreq> values (Google, build and submit a sitemap).
  • loc length, changefreq and priority. A loc value must be less than 2,048 characters. changefreq must be one of always, hourly, daily, weekly, monthly, yearly or never. priority must be from 0.0 to 1.0 (sitemaps.org protocol).
  • Location of the sitemap. If you type the sitemap URL, the validator flags each loc on a different protocol, host or port, or outside the directory of the sitemap file. The protocol says that a sitemap at http://example.com/catalog/sitemap.xml can include URLs that start with http://example.com/catalog/ but not URLs that start with http://example.com/images/ (sitemaps.org protocol, file location). Google applies the directory rule only to a sitemap that you do not submit through Search Console.
  • Sitemap index placement. Referenced sitemaps must be hosted on the same site as the index, unless you set up cross-site submission. They must also be in the same directory as the index or lower. For example, an index at https://example.com/public/sitemap_index.xml can only contain sitemaps in the same or a deeper directory, like https://example.com/public/shared/... (Google, sitemap index best practices).

Size limits and splitting

Google's build-and-submit guide gives the limit for all formats, 50MB uncompressed or 50,000 URLs per sitemap. If you have a larger file or more URLs, you must break your sitemap into multiple sitemaps. You can optionally create a sitemap index file and submit that single index file to Google. Google adds that submitting several sitemaps may be useful if you want to track the search performance of each sitemap in Search Console.

The protocol allows gzip compression, but the file once uncompressed must be no larger than 50MB. This validator cannot read a .gz file. Decompress it first (for example with gunzip -k sitemap.xml.gz) and paste the XML. The validator counts the UTF-8 bytes of the pasted text and reports a file above 52,428,800 bytes, or with more than 50,000 entries, as an error. For a file close to the limit, check its size on disk as well.

Sitemap index rules

Google says that the XML format of a sitemap index file is very similar to the format of a sitemap file, and that all the sitemap requirements apply to sitemap index files also. These rules are specific to an index.

  1. The root element is <sitemapindex>. Each <sitemap> child has its own <loc> that points to a sitemap file, not to a page.
  2. The referenced sitemaps must be on the same site as the index, unless you set up cross-site submission, and in the same directory as the index or lower.
  3. An index may list up to 50,000 sitemaps, and you can submit up to 500 sitemap index files for each site in Search Console.

The validator reads the root element to tell a sitemap from an index and applies the matching checks.

Sample files

Load a sample into the validator. The broken samples break the rules named in the sample description. A file that does not parse as XML shows only the parse error, so Case 4 shows the ampersand error and not the relative URL.

What a result means

Google says that a sitemap "helps search engines discover URLs on your site, but it doesn't guarantee that all the items in your sitemap will be crawled and indexed" (Google, sitemaps overview). A clean result here means that the file passes the checks on this page. It does not make Google crawl or index a page.

If a URL in a valid sitemap is still not crawled, the robots.txt tester shows whether a robots.txt rule blocks it.

Questions

Can the validator fetch my sitemap from a URL?

No. The validator makes no network request. Copy the file contents and paste them. The URL field is used only to compare text.

Does it validate image, video or news extensions?

No. It checks the sitemap and sitemap index rules listed above. Tags from other namespaces, such as <video:video>, are checked only as part of well-formed XML.

My sitemap passes here but Search Console reports an error. What then?

This validator checks only the text that you paste. It does not check how your server sends the file. Open the exact URL that you submitted, check that it returns the same XML, and then submit the sitemap again in Search Console.

Should I keep <priority> and <changefreq>?

Google ignores both values. The protocol defines both as optional tags and says that support for optional tags may vary among search engines. For lastmod, the protocol says that the date must be set to the date the linked page was last modified, not when the sitemap is generated.

Disclosures

This page summarizes the sitemaps.org protocol, the sitemaps.org XML Schema and Google's published Search Central documentation on building and submitting sitemaps, sitemap indexes and large sitemaps. It has no relationship with Google. It does not promise a crawling or indexing result.