A sitemap validator checks that a sitemap file is well-formed XML in the sitemaps.org format, stays within 50,000 URLs and 50 MB, and lists only absolute, canonical, indexable URLs. Paste your sitemap or drop the file below; it is checked in your browser.
Validate your sitemap
Errors and warnings come with line numbers and the message Search Console would show. When something needs fixing, you get a corrected file to download. Nothing is uploaded and no URL is fetched.
The validator reads the XML itself, so it catches what makes Search Console say a sitemap ‘could not be read’ or ‘has errors’: unescaped characters, a wrong namespace, relative URLs, bad lastmod dates and files over the size limits. To send the URLs from a clean sitemap for crawling, Rapid URL Indexer accepts pasted URL lists in bulk; if you are new to it, start here with the features overview.
How to copy a sitemap into the validator
- Find the sitemap URL. It is often listed on a Sitemap: line in yoursite/robots.txt, or shown in your CMS or SEO plugin settings, or in Search Console’s Sitemaps report.
- Open it in the browser. A sitemap often opens with a stylesheet that makes it readable for people; prefix the address with view-source: or use the view-source shortcut (Ctrl+U on Windows and Linux, Cmd+Option+U on macOS) to get the raw XML.
- Select all (Ctrl+A or Cmd+A), copy, and paste into the box above. For a large file, save it (Ctrl+S) and drop the file on the box instead.
- A compressed sitemap (.xml.gz) can be dropped as it is: the validator unpacks it in your browser, and the size limit is checked on the unpacked XML, as the protocol requires.
- For a sitemap index, validate the index first, then each sitemap it lists.
What the validator checks
The rules come from the sitemaps.org protocol, which Google supports, and from Google’s sitemap documentation and the Sitemaps report error list in Search Console Help.
XML syntax and namespace
A sitemap is an XML file, so one syntax error can stop it from being read at all. The protocol requires UTF-8 and says all data values, including URLs, “must use entity escape codes” for the ampersand, single and double quotes, and the angle brackets (sitemaps.org, Sitemaps XML format). The most common break is an unescaped & in a URL with parameters. Search Console’s help for the ‘Parsing error’ message says that often “this problem is caused by an unescaped character in the URL”.
The root element must be <urlset> for a sitemap or <sitemapindex> for an index, with the namespace xmlns="http://www.sitemaps.org/schemas/sitemap/0.9". Search Console Help notes the namespace must end in 0.9 and that attribute quotes must be straight, not the curly quotes word processors insert. The validator also flags whitespace before the XML declaration, which Search Console reports as ‘Leading whitespace’, plus mismatched or unclosed tags, each with its line number.
Size limits: 50,000 URLs and 50 MB
Each sitemap file may list at most 50,000 URLs and be no larger than 50 MB (52,428,800 bytes) uncompressed; the same limits apply to a sitemap index and the number of sitemaps it lists (sitemaps.org, Sitemaps XML format). Google applies the same numbers in its sitemap guide and asks you to break a bigger file into several sitemaps. The protocol also allows gzip compression to save bandwidth, as long as the unpacked file stays within 50 MB. The validator measures the file in bytes as UTF-8, counts the entries, and splits the corrected output into files of 50,000 when needed.
Listing 50,000 URLs only gets them discovered. To request crawling for them, you can index thousands of URLs at once through an indexing service, without Search Console access. Each Rapid URL Indexer project accepts up to 9,999 URLs, so a sitemap at the full 50,000-URL limit fills 6 projects: five full projects hold 49,995 URLs (5 × 9,999), and the last 5 URLs go into a sixth. When a sitemap passes, the validator shows the same count for your file.
URL format, host and protocol
- Absolute URLs. Google’s sitemap guide asks for “fully-qualified, absolute URLs” and says Google crawls URLs exactly as they are listed. A relative URL such as /about/ is an error. If you give the sitemap’s own URL, the validator resolves relative URLs against it in the corrected file.
- Length and characters. A <loc> value must be shorter than 2,048 characters (sitemaps.org). Spaces and quotes need URL encoding, and non-ASCII characters should be percent-encoded.
- One host and protocol. “All URLs in a Sitemap must be from a single host”, and a sitemap can only list URLs in its own folder or below (sitemaps.org, Sitemap file location). Search Console reports URLs on another host or a higher folder as ‘URL not allowed’. Without the sitemap’s own URL, the validator compares each URL with the host and protocol most of the file uses.
- Duplicates. Search Console counts a duplicate URL once; the corrected file keeps one copy.
lastmod dates
lastmod must use the W3C Datetime format: a date such as 2025-06-30, or a date and time with a time zone such as 2025-06-30T18:00:15+00:00. Search Console Help adds that the time is optional, “but if you do specify a time, you must also specify a time zone”. The date should be the last significant change to the page, not the day the sitemap was generated. In its sitemap guide Google says it uses lastmod when the value is “consistently and verifiably” accurate, and the announcement that retired the sitemap ping endpoint explained that a lastmod which does not match reality eventually stops being believed. The validator flags dates in the wrong format, dates that do not exist (such as February 30), times without a zone and dates in the future. Google ignores <changefreq> and <priority>; the validator checks their values but leaves valid ones alone.
Image, video, news and hreflang extensions
Google supports sitemap extensions for images, video and news content and for the language versions of a page, each in its own namespace such as xmlns:image or xmlns:xhtml. The validator checks that every prefix is declared, keeps all extension tags in the corrected file, and checks hreflang links: each needs rel="alternate", a full URL, and a code made of an ISO 639-1 language with an optional region, such as en-GB, or x-default. It also warns when a page’s hreflang set leaves out the page itself. The inside of image, video and news tags is not checked against those extensions’ own rules.
Search Console sitemap errors explained
The Sitemaps report in Search Console shows one of three statuses per sitemap: Success, Has errors, or Couldn’t fetch. Each issue in the validator’s result names the Search Console message it matches. Bing Webmaster Tools accepts the same file. Submitting your site to other search engines is covered step by step in our submission checklist, along with IndexNow and the regional engines.
‘Sitemap could not be read’, ‘Has errors’, invalid URL, invalid date
| Message | What it means | Fix |
|---|---|---|
| Sitemap could not be read | The fetch failed or the file could not be parsed at all | Check the file loads in a browser, then validate the XML; fix parsing errors first |
| Has errors (Sitemap had X errors) | The file was read, but some entries are invalid; Google still queues the URLs it could parse | Fix the listed entries and resubmit the sitemap |
| Parsing error | Google could not parse the XML, often because of an unescaped & | Escape & as & and fix broken tags |
| Invalid URL | A URL has unsupported characters, spaces or quotes, or a typo in the scheme | Encode the URL or correct it |
| Invalid date | A lastmod is not in W3C Datetime format, or has a time without a time zone | Use YYYY-MM-DD or add the zone |
| Incorrect namespace | The root element’s namespace is missing or wrong | Use the exact sitemaps.org 0.9 namespace |
| URL not allowed | A URL is on another host, protocol or a higher folder than the sitemap | Move the sitemap to the root or list only matching URLs |
| Compression error | Google could not unpack a gzip-compressed sitemap | Compress the file again with gzip, upload it and resubmit |
| Too many URLs | More than 50,000 URLs in one file | Split the file and use a sitemap index |
‘Has errors’ does not block the whole file: according to Search Console Help, any URLs that could be parsed without errors are queued for crawling. ‘Couldn’t fetch’ is different from both, because Google never got the file; next, fix ‘Couldn’t fetch’ when submitting a sitemap with the access checks in our submission guide.
URLs that should not be in your sitemap
Google’s sitemap guide says to list the URLs you want to see in search results, which means your canonical URLs. Its canonicalization page rates a sitemap entry as a weak canonical hint and warns against listing one URL in the sitemap while rel=canonical names another. So take out URLs that redirect, return 4xx or 5xx, carry noindex, are blocked by robots.txt or canonicalise to another URL. To find the blocked ones, test those URLs against your robots.txt before you trim the list. We explain why Google may choose a different canonical than the one you list in our canonical tag guide.
Keep in mind what a sitemap does. Search Console Help says there is “no guarantee that a page URL discovered in a sitemap has been or will be crawled or indexed by Google”. If clean sitemap URLs stay unvisited, read our guide to sitemap URLs stuck as discovered; the fixes there are links and crawl capacity, not the sitemap.
The cross-check below compares your sitemap with a crawler export (status code, canonical and indexability columns) and lists the sitemap URLs to remove, plus indexable pages that are missing from the sitemap.
Sitemap vs indexable URL cross-check
Works with exports that have an Address or URL column plus any of: Status Code, Indexability, Indexability Status, Canonical Link Element 1, Meta Robots 1, Content Type. Nothing is uploaded.
Sitemap index validation
A sitemap index lists sitemaps instead of pages. It uses the same namespace, <sitemapindex> as the root and one <sitemap> entry with a <loc> per file, and it may list up to 50,000 sitemaps (Google Search Central, Manage your sitemaps with a sitemap index file). Three rules catch people out. The listed sitemaps must be on the same site as the index and in the same folder or deeper, unless you set up cross-site submission. Each <loc> needs the full URL; Search Console reports ‘Invalid URL in sitemap index file: incomplete URL’ when the path is missing. And an index cannot list other index files, which Search Console reports as nested sitemap indexes. Paste the index into the validator to check these, then validate each listed sitemap on its own.
Frequently asked questions
How do I check if my sitemap is valid?
Paste the sitemap XML into the validator on this page, or drop the file (plain or gzip). It checks XML syntax, the namespace, size limits, URL format and lastmod dates, and gives line numbers. After you submit it, the Sitemaps report in Search Console shows Success when Google could read it. A valid sitemap is one item among many; our full checklist of technical checks covers the rest.
Why does Search Console say my sitemap could not be read?
Either Google could not fetch the file, or it fetched it and could not parse the XML. Open the sitemap URL in a browser to confirm it loads, then validate the XML here; an unescaped & in a URL is the usual parsing problem. If you would rather rebuild the file than repair it, our generator page explains the XML sitemap format and creates a file from a URL list. Other ways to get URLs crawled are weighed against each other in Search Console vs indexing service.
Should noindexed or redirected URLs be in a sitemap?
A sitemap should list only canonical URLs you want in search results. Redirected URLs, noindexed pages, error pages and URLs that canonicalise elsewhere send mixed signals, so replace redirects with their final URL and remove the rest. The cross-check on this page finds them from a crawler export.
How do I validate a sitemap index?
Paste the index into the validator. It checks the <sitemapindex> root, the namespace, that every <loc> is a full URL on the same host, and the 50,000-sitemap limit. Then validate each listed sitemap separately, because the index check does not open the files it lists.