OG ScopeOG Scope
Free sitemap validator tool

XML Sitemap Validator

Check a sitemap.xml file, a sitemap index, or a text sitemap against the sitemaps.org protocol, with the line number of each error.

Try ogscope.pk, memetap.pk, or digitaldialogue.pk. A bare domain is checked through robots.txt, then /sitemap.xml.

How it works

Paste a sitemap address and read what a search engine reader would trip over, from XML syntax to dates and limits.

  1. Step 1

    Enter the sitemap URL

    Paste the address of sitemap.xml, a sitemap index, a .gz file, or a text sitemap. A bare domain is looked up in robots.txt, then at /sitemap.xml.

  2. Step 2

    Read the file

    The server downloads the file once, removes gzip, and checks that it is UTF-8 and well-formed XML, line by line.

  3. Step 3

    Check the protocol rules

    Every entry is checked for a full <loc>, a valid lastmod date, changefreq and priority values, the host, and the 50,000 URL and 50 MB limits.

  4. Step 4

    Fix and validate again

    Errors and warnings are grouped, each with line numbers and examples. A sitemap index lists its sitemaps so each one can be checked next.

What the sitemap validator checks

This XML sitemap validator downloads the file the way a crawler does, without cookies or JavaScript, and checks it in three passes. First the bytes: the file must be UTF-8 and no larger than 50 MB once gzip is removed. Then the XML: every tag must close, nest correctly, and escape its special characters. Then the sitemaps.org protocol: the root element and namespace, each URL entry, and the limits on how many URLs one file can hold.

Problems are sorted into errors, which make the file invalid, warnings, which a reader may accept but which usually point at a mistake, and notes. Each one shows how often it occurs and the line numbers of the first examples, so the fix can start in the right place. The sitemap errors guide matches those results to the messages in Search Console.

A laptop showing an XML file icon beside five checked rows, one with a warning and one with an error, and a magnifying glass.

XML errors and the unescaped ampersand

An XML reader stops at the first syntax error, so a single broken line can hide every URL after it. The most common one is a raw & in a URL with more than one query parameter. In XML it has to be written as &amp;. The same applies to <, which becomes &lt;.

<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
  <url>
    <loc>https://www.example.com/shoes?color=red&amp;size=9</loc>
    <lastmod>2026-01-15</lastmod>
  </url>
</urlset>

Other sitemap errors in this group are a closing tag that does not match the one that opened, a file cut off before </urlset>, and blank lines or spaces before the <?xml declaration, which must be the first thing in the file. When the address returns an HTML page instead, the result says so, because a login page or a 404 template is a common reason a sitemap cannot be read.

URL rules: full addresses on one host

Every <url> entry needs one <loc> with an absolute URL that starts with http:// or https://. A relative path such as /about is an error, and so is a URL of 2,048 characters or more. Spaces in a URL are flagged, because a URL in a sitemap should be escaped, with a space written as %20.

The protocol also ties URLs to the location of the sitemap. A sitemap on https://www.example.com/ covers URLs on that same protocol and host, so entries on http:// or on another subdomain are reported as warnings. The www host and the bare domain are treated as one site, because most sites redirect one to the other, and the difference is shown as a note. A sitemap at /blog/sitemap.xml covers only URLs under /blog/. The protocol's section on cross submits describes how a sitemap can list URLs from other sites, through the robots.txt file of each site. Duplicate URLs are listed too, since each URL only needs one entry.

The listed URLs should be the canonical addresses. The meta tag checker shows the canonical URL a page declares, and the og:url guide explains how the canonical and og:url should agree.

lastmod, changefreq, and priority

<lastmod> must use the W3C Datetime format: 2026-01-15, or a date and time with a time zone such as 2026-01-15T09:30:00+00:00. A date like 15/01/2026, a time with no time zone, or a day that does not exist is an error. A lastmod date in the future is a warning, because the value is meant to be the date the page last changed. Google's sitemap documentation says it uses lastmod only when it is consistently and verifiably accurate.

<changefreq> accepts always, hourly, daily, weekly, monthly, yearly, or never, in lowercase. <priority> accepts a number from 0.0 to 1.0. Both tags are optional, and Google's documentation says it ignores them, so the result adds a note when they are present. Other search engines may still read them.

Sitemap index files, gzip, and the 50,000 URL limit

One sitemap can hold up to 50,000 URLs and 50 MB (52,428,800 bytes) of uncompressed data. A larger site splits its URLs into several files and lists them in a sitemap index, which uses <sitemapindex> and <sitemap> entries with only <loc> and <lastmod>.

<?xml version="1.0" encoding="UTF-8"?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
  <sitemap>
    <loc>https://www.example.com/sitemap-pages.xml</loc>
    <lastmod>2026-01-16</lastmod>
  </sitemap>
</sitemapindex>

To validate a sitemap index, enter its address. The result checks the index and lists each sitemap it points to with a Validate link. Validate sitemap files from a large index one at a time, starting with the ones that changed last. Sitemaps listed on another host are flagged, since an index should list sitemaps on its own site. Files ending in .gz are decompressed before the check.

Image, video, news, and hreflang tags from their own namespaces are allowed inside a <url> entry and counted in the result. A prefix such as image: used without its xmlns:image declaration is reported as an error.

Text sitemaps and feeds

A text sitemap lists one full URL per line and nothing else. The sitemap checker reads it with the same URL rules, so a line with a relative path or a note is an error. An RSS or Atom feed is recognized and reported, but its entries are not checked, because the feed format has its own rules.

After the check

The result also says whether robots.txt on the same site has a Sitemap: line for the file. That line, or a submission in Search Console, is how search engines are told where the sitemap is. When the sitemap address redirects, the result shows the final address, which is the one to list.

A site with no sitemap can get one from the XML sitemap generator, which crawls the site and writes sitemap.xml and a sitemap index for large sites. To check sitemap URLs that move, run them through the redirect checker.

Limits of the check

Frequently asked questions

Does a valid result mean Google will index every URL?
No. A sitemap is a hint about which URLs exist. A valid file can be read without errors, but each page is still crawled and judged on its own, and Google decides what to index.
Can it check a sitemap.xml.gz file?
Yes. A gzip file is decompressed on the server and checked as XML. The 50 MB limit applies to the uncompressed size, so a small .gz file can still be over the limit.
Does it check every sitemap in a sitemap index?
It checks the index file itself and lists the sitemaps it points to, each with a Validate link. Each child sitemap is checked when it is opened, so one large index does not turn into hundreds of requests at once.
Is a sitemap on the bare domain with www URLs a problem?
Not here. Most sites redirect one host to the other, so www.example.com and example.com are checked as one site and the difference is shown as a note, not a warning. The protocol's strict rule treats them as different hosts, so serving the sitemap from the host its URLs use removes any doubt.
Does it fetch each page listed in the sitemap?
No. It reads the sitemap file only. To find listed pages that redirect, return an error, or carry noindex, crawl the site with the sitemap generator or check single URLs with the redirect checker.
Is the result saved?
No. Each check fetches the file again and nothing is kept, so a fix shows up on the next check.