An XML sitemap validator that shows the exact line
This XML sitemap validator checks a sitemap.xml, a gzipped sitemap.xml.gz or a sitemap index against the sitemaps.org protocol and the extensions Google reads — images, videos, news and hreflang alternates. Every problem is reported with its line number and a plain explanation of the fix, summarised in a scored checklist and listed in full in a table you can download as CSV.
Enter the sitemap’s address and it is fetched for you, or paste the XML or upload the file. Uploads are checked in your browser, so a sitemap from a staging server or your own computer works too. For a sitemap index, every child sitemap is listed and can be checked one at a time or ten at once, with the requests spaced out so large sites don’t run into the fetch limit.
How to validate a sitemap
- Choose Sitemap URL and enter the address — usually
/sitemap.xmlor/sitemap_index.xml, and robots.txt normally names it — or switch to Paste or Upload. - For pasted or uploaded files, optionally fill in Where this sitemap lives, so the same-host and same-folder rules can be checked.
- Press Validate sitemap and read the checklist first: High items can make search engines skip entries or the whole file.
- Use the issue table to see every problem by line, filter it by level, and press Download CSV to share the report.
- For a sitemap index, press Check the first 10 (or Check on one row); Open report shows a child’s full report, and Back to the sitemap index returns.
- Optionally press Check status to ask a sample of URLs for their live HTTP status.
XML Sitemap Validator features
Real XML parsing with line numbers
A strict scanner stops at the first well-formedness error, as the parsers search engines use do, and names the line and column — then lists the other unescaped “&” characters it can see.
The whole protocol
Namespace, root element, one <loc> per entry, absolute same-host URLs, the 50,000-URL and 50 MB limits, W3C Datetime lastmod values, duplicates and http/https mixes.
Google’s extensions
Image, video and news tags are checked against Google’s current documentation, deprecated tags are noted as ignored, and hreflang sets are checked for valid codes, self-references and return links.
Sitemap index follow-up
Child sitemaps are fetched on request, and nested indexes, missing files and children with errors are reported in the index’s checklist.
Live status sample
Optional status checks catch listed pages that return 404, redirect elsewhere or send an X-Robots-Tag noindex header.
Gzip and encodings
.xml.gz files are unpacked in the browser, and files that aren’t valid UTF-8, or declare another encoding, are flagged.
What the validator checks
| Area | Rule | Source |
|---|---|---|
| File | Well-formed XML, UTF-8, at most 50,000 URLs and 50 MB (52,428,800 bytes) uncompressed | sitemaps.org protocol |
| Root | <urlset> or <sitemapindex> with xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" | sitemaps.org |
| URLs | Absolute, fewer than 2,048 characters, entity-escaped, on the sitemap’s host and inside its folder | sitemaps.org |
| lastmod | W3C Datetime, such as 2026-10-14 or 2026-10-14T09:30:00+05:30 | W3C note on date formats |
| changefreq, priority | Allowed values; noted as ignored | Google Search Central |
| Images | One image:loc per image:image, at most 1,000 per URL; caption, title, geo_location and license are deprecated | |
| Videos | Thumbnail, title, description and a content or player URL; duration 1–28,800 seconds; rating 0.0–5.0 | |
| News | Publication name and language, publication date and title; articles from the last two days; at most 1,000 | |
| hreflang | rel="alternate", valid language-region codes, absolute URLs, the page itself and return links |
Worked example: reading the built-in report
The example sitemap has five entries. Line 27 lists http://www.example.com/blog/spring sale/: the space is an error (use spring-sale, or encode it as %20), and because the other URLs use https:// the validator also warns about the protocol mix. Line 28’s 2026-13-02 fails because month 13 doesn’t exist, and line 31 repeats the wallet page from line 17, so it is reported as a duplicate.
Two subtler findings follow. The home page names the German page as its de alternate on line 9, but the German entry doesn’t link back, so Google would ignore the pair. And the wallet’s <image:caption> is noted as deprecated, while changefreq and priority are valid but ignored by Google. The total is 2 errors, 3 warnings and 2 notes.
Fixing the most common sitemap errors
To start again from a clean list, build a fresh file with the XML Sitemap Generator; to export every address a sitemap contains, use the Sitemap URL Extractor, and reference the final file from robots.txt.
- Unescaped ampersand — a URL such as
?color=red&size=mmust be written?color=red&size=minside XML. One bare “&” makes the whole file unreadable. - Blank line before <?xml — the declaration must be the very first characters; a stray newline from a template or plugin breaks parsing.
- Undeclared prefix —
<image:image>withoutxmlns:imageon the root element is a fatal error. - Generated lastmod — when every URL carries the time the file was built, Google learns to ignore the dates. Use each page’s real modification time.
- Redirecting or broken URLs — list only final, indexable, canonical addresses. Use the status sample here, or the HTTP Status Checker for single pages.
XML Sitemap Validator FAQ
How do I validate my XML sitemap?
Enter its address in this XML sitemap validator and press Validate sitemap, or paste or upload the file. You get a checklist, every issue with its line number, and a CSV export.
What is the maximum size of a sitemap?
50,000 URLs and 50 MB (52,428,800 bytes) uncompressed per file. Gzip saves bandwidth, but the limit still applies to the unpacked size. Larger sites split their URLs into several sitemaps and list them in a sitemap index.
Does Google use changefreq and priority?
No. Google’s sitemap documentation says it ignores both. It does use lastmod, but only when the dates are consistently accurate. The validator still checks their values, because other tools may read them.
Can a sitemap index contain another sitemap index?
No — sitemap indexes can’t be nested. An index lists sitemap files, and each of those lists pages. The validator flags a child that turns out to be another index.
Why does Search Console say it couldn’t fetch a sitemap this tool reads?
Search Console fetches as Googlebot, which firewalls or bot protection may treat differently. Check that robots.txt doesn’t block the file and that it returns 200 with an XML content type, then resubmit.
Is my sitemap uploaded anywhere?
No. Pasted and uploaded files are read in your browser and never sent anywhere. Only addresses you enter — plus child sitemaps or sample URLs you choose to check — are fetched through this site’s server.