By · Updated

Sitemap Validator

sitemap.xml and Sitemap Index Files Checked Against the sitemaps.org Protocol

No ratings yet

OneTask is free, with no sign-up, and built by one person.
If this tool saved you time, a coffee helps keep new ones coming.

How the Sitemap Validator works

This sitemap validator checks a sitemap against the protocol. Paste the URL of a sitemap.xml or a sitemap index — or the file's contents — and it is checked the way a search engine's fetcher checks it: is the XML well-formed, is the namespace right, does every entry have an absolute loc, are the lastmod dates in W3C format, are changefreq and priority legal, and is the file within the 50,000-entry and 50 MB limits. Duplicates, mixed http and https, URLs on other hosts, utm_ parameters and # fragments are flagged as warnings. Plain-text sitemaps — one URL per line — are checked too.

Sitemap validator: the protocol limits

A sitemap is a list of the URLs you want crawled, in a format defined at sitemaps.org and read by Google, Bing and every other engine. It is one of the few direct channels you have to a crawler, and it is also one of the quietest failures on the web: a sitemap that does not parse is silently ignored, and Search Console may take days to tell you. This validator applies the protocol's rules before you submit.

Well-formed XML first. The file must parse. The commonest cause of failure is an unescaped & in a URL — ?a=1&b=2 must be written ?a=1&b=2 inside XML. A stray non-UTF-8 byte, an unclosed tag, or a BOM before the declaration will also break it. If the parser fails, the line and column are reported and nothing else is checked, because nothing else can be.

The right shape. A URL sitemap is a urlset containing url elements; an index is a sitemapindex containing sitemap elements; both must declare xmlns="http://www.sitemaps.org/schemas/sitemap/0.9". A missing or misspelt namespace — a trailing slash, https, 1.0 — is the second commonest reason a sitemap is rejected outright. Each entry must have exactly one loc. Index entries may have lastmod but not changefreq or priority. Elements from the image, video, news and xhtml extensions are counted rather than validated; unknown elements in the sitemap namespace are warned about.

URLs. Every loc must be absolute, starting with http:// or https://, under 2,048 characters, and with special characters percent-encoded. Search engines only accept URLs on the same host as the sitemap file, so a sitemap that mixes hosts is warned about, as is one that mixes http and https — list the canonical scheme only. URLs with # fragments are warned about because crawlers strip them, and URLs with utm_ parameters because they are not the canonical address and will be reported as duplicates. Actual duplicates within the file are counted and each one points at the earlier entry.

Dates, frequency and priority. lastmod must be W3C datetime: 2025-03-14 or 2025-03-14T09:30:00+00:00. It is the one optional field that matters: Google uses it to decide what to recrawl, provided it is accurate — a lastmod that is set to now on every generation is worse than none, and one in the future is flagged. changefreq must be one of always, hourly, daily, weekly, monthly, yearly, never, and priority a number from 0.0 to 1.0; both are validated, though Google has said for years that it ignores them, and a file where every URL is priority 1.0 is warned about because it carries no information.

Limits. 50,000 entries and 50 MB uncompressed per file, for both sitemaps and indexes. Above that, split into several sitemaps and list them in an index. The size shown is of what you pasted; a gzipped sitemap on the server is measured by its uncompressed size.

Plain-text sitemaps. A file of one absolute URL per line is also a valid sitemap. If the input does not start with < it is treated as one and each line is checked to be an absolute URL.

What it does not do. It does not fetch the URLs, so it cannot tell you which ones return 404 or redirect, or whether the sitemap is referenced from robots.txt. Search Console's coverage report does the first after submission; the robots.txt tester covers the second.

FAQ

My sitemap generator adds changefreq and priority — should I remove them?

They do no harm if the values are valid, and this tool checks that they are. But Google ignores both, and Bing largely does too, so they are dead weight. lastmod is the field worth getting right: an accurate modification date is what earns a recrawl.

Why does it say my URL contains an unescaped ampersand?

Because the XML failed to parse at that point. In XML, & starts an entity reference, so a URL with query parameters must be written with &amp; between them. The browser un-escapes it when reading. Most generators do this for you; hand-written sitemaps and simple template loops usually do not.

Can a sitemap list URLs on a different domain?

Not normally. A sitemap at https://example.com/sitemap.xml may only list URLs under https://example.com/. www.example.com and http://example.com are different hosts. The exception is cross-site submission via robots.txt, where the sitemap URL is declared in each site's robots file; if you are not doing that, the warning here means those URLs will be dropped.

Should the sitemap be gzipped?

It can be, and for large sites it should — the 50 MB limit is on the uncompressed size, but the fetcher's time and your bandwidth are both saved. Serve it as sitemap.xml.gz with the right content type. Paste the uncompressed XML here to validate it.

How do I split a sitemap that is over the limit?

Create several sitemap files each under 50,000 URLs — by section, by date, or just by number — then create a sitemap index that lists each one with its own loc and lastmod. Submit the index URL to Search Console and reference it in robots.txt. This tool validates the index file too; paste it and it will be recognised by its sitemapindex root.

See also: all SEO tools, Dev Utilities, Formatters & Validators, Data & Encoding, Security & Identifiers, Accessibility, AI.

Related tools