XML Sitemap Validator
Validate sitemap.xml and sitemap-index files — well-formedness, required fields, date formats, and the 50,000-URL / 2,048-char spec limits.
Paste a sitemap.xml to validate it.
How sitemap.xml validation works
A valid XML sitemap has a <urlset> root, and each <url> must contain a <loc> with an absolute URL; optional fields are <lastmod> (W3C date), <changefreq>, and <priority>(0.0–1.0). This validator parses your file with the browser’s native XML engine (so it also catches genuine well-formedness errors and unescaped &), detects sitemap-index files (<sitemapindex> / <sitemap>), flags duplicate <loc> entries, and enforces the sitemaps.org limits (50,000 entries, 2,048-character URLs). Everything runs locally in your browser.
Built and maintained by Meet Shah · Last updated
What this tool is used for
- Checking a sitemap's structure before submitting it to a search engine.
- Finding a malformed date or a missing required element.
- Validating a generated sitemap after a template change.
- Confirming a sitemap index references its children correctly.
- Checking a sitemap against the URL and size limits.
Frequently Asked Questions
- What does the sitemap protocol require?
- A `<urlset>` root in the `http://www.sitemaps.org/schemas/sitemap/0.9` namespace, with each `<url>` containing at least a `<loc>`. Everything else — `lastmod`, `changefreq`, `priority` — is optional, and the namespace is the part most hand-written sitemaps get wrong.
- What are the size limits?
- 50,000 URLs and 50 MB uncompressed per file. Past either, split into several files and list them in a sitemap index, which has the same 50,000 cap on its own entries. Exceeding a limit means the file is rejected outright rather than truncated.
- Do changefreq and priority do anything?
- Not for Google, which has said publicly it ignores both — they were set to `always` and `1.0` on every URL too often to carry information. `lastmod` IS used when it is consistent and honest, which is the one optional field worth maintaining.
- Why must URLs be absolute and same-host?
- Because a sitemap only speaks for the location it sits at. A sitemap at `example.com/sitemap.xml` cannot list URLs on another domain, and a relative path has no meaning to a crawler that fetched the file directly. Both are rejected rather than resolved.
- Do the URLs need escaping?
- Yes — it is XML, so `&` must be `&` and the same for `<` and `>`. A query string with two parameters is the usual place this breaks, and an unescaped ampersand makes the whole document fail to parse rather than dropping one URL.
Common errors and gotchas
- Validating structure and assuming the URLs are indexable, which is a different question.
- Overlooking relative URLs, which are invalid in a sitemap and easy to generate by accident.
- Missing that a sitemap index cannot contain page URLs, only other sitemaps.
- Exceeding the 50,000 URL limit rather than splitting into an index.
- Using a non-conforming last-modified format, which is ignored rather than rejected.