Embed this tool on your site
About this tool
An XML sitemap that does not parse, or whose entries lack usable URLs, gives search engines nothing to crawl. The XML Sitemap Validator runs a quick structural check on sitemap XML you paste. It parses the text with the browser's XML parser and reports any parse error (unclosed tags, unencoded ampersands and similar syntax problems), confirms the root element is <urlset>, checks that there is at least one <url> entry, and verifies that every <url> has exactly one <loc> containing an absolute http or https URL. Issues are listed with the url entry number and, where possible, an approximate line. When everything passes you see the number of url entries. It does not check the namespace, lastmod, changefreq or priority values, the 50,000-URL and 50MB limits, or URL length, and sitemap index files (<sitemapindex>) are reported as missing <urlset>. Use Search Console for those checks.
Why use it
Well-Formed XML Check: The browser's XML parser runs first, so unclosed tags, unencoded ampersands and other syntax errors show up as a parse error with the parser's own message.
Urlset Structure: Confirms the root element is <urlset> and that it contains at least one <url> entry.
Loc Checks: Every <url> must have exactly one <loc>, and each <loc> must parse as an absolute http or https URL — relative paths and other schemes are flagged.
Approximate Line Hints: Errors for invalid URLs point to an approximate line number so you can jump to the problem area in large files.
Private by Default: Validation runs in your browser with DOMParser; the XML you paste is not uploaded.
How to use
- Paste your sitemap XML into the Sitemap XML field (fetching a sitemap by URL is not supported)
- Click Validate
- Read the numbered Issues list — each entry names the url number and, where possible, an approximate line
- Fix the reported errors in your sitemap source (CMS settings, sitemap plugin configuration, or generator script)
- Re-run until you see "No structural issues detected" and the valid entry count, then submit the sitemap in Google Search Console or Bing Webmaster Tools
When it helps
- Before submitting a new sitemap to Google Search Console or Bing Webmaster Tools for the first time
- After migrating a CMS or switching sitemap plugins to check the XML still parses and every entry has a valid <loc>
- When Search Console reports a sitemap it could not read and you want to rule out XML syntax errors
- When adding a new content type or section to an existing sitemap and want to confirm the new entries have valid URLs
- When building a custom sitemap generator script and need a quick check that its output parses and has valid <loc> URLs
- When auditing a client site and want a fast first-pass structural check of its sitemap
Examples
Input<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url><loc>https://example.com/page</loc><lastmod>2024-06-15</lastmod></url>
</urlset>
Expected resultValid structure: 1 url entry.
No structural issues detected.
Input<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url><loc>/about</loc></url>
</urlset>
Expected result1. url #1 invalid URL in <loc> (line ~2).
Input<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<sitemap><loc>https://example.com/sitemap-1.xml</loc></sitemap>
</sitemapindex>
Expected result1. Missing required root element: <urlset>.
2. No <url> entries found inside <urlset>.
Tips
- Only include canonical URLs in your sitemap — if a page has a rel=canonical pointing elsewhere, including the non-canonical version can confuse crawlers
- Update lastmod only when the page content genuinely changes — setting it to today's date on every build teaches Google to distrust your dates
- Split large catalogs into themed child sitemaps (e.g., sitemap-products.xml, sitemap-blog.xml) rather than one monolithic file to make crawl diagnosis easier in Search Console
- Validate your sitemap in both Google Search Console and this tool — Search Console may catch live fetch issues (redirects, authentication) that a structural validator cannot
- Ensure your sitemap URL is referenced in robots.txt with a Sitemap: directive so crawlers can discover it even without a Search Console submission
Frequently Asked Questions
What is the maximum number of URLs allowed in a single sitemap?⌄
The Sitemap Protocol 0.9 specification limits a single sitemap file to 50,000 URLs and 50MB uncompressed. Sites with larger catalogs must use a sitemap index file that references multiple child sitemaps, each within these limits. This tool does not enforce these limits.
Does the lastmod date actually influence crawl frequency?⌄
Google uses lastmod as a hint, not a guarantee. If lastmod values are accurate and updated when content changes, Google may crawl those URLs more frequently. However, setting lastmod to today's date on every page regardless of changes trains crawlers to ignore it.
Is changefreq required, and does Google use it?⌄
changefreq is optional and Google has stated publicly that it largely ignores it in favour of its own crawl-frequency signals. If present it should use one of the protocol values (always, hourly, daily, weekly, monthly, yearly, never); this tool does not check it.
Why must URLs in sitemaps use XML entity encoding?⌄
Sitemaps are XML documents, so characters like &, ', ", < and > must be written as &, ', ", < and >. An unencoded ampersand in a URL with query parameters breaks the XML, and this tool reports it as a parse error.
What XML namespace declaration is required?⌄
The root <urlset> element must include xmlns="http://www.sitemaps.org/schemas/sitemap/0.9". Missing or incorrect namespace declarations can cause Google's sitemap parser to reject the document. This tool does not check the namespace, so confirm it yourself.
Can I validate a sitemap index file?⌄
No. The tool expects a <urlset> root, so a <sitemapindex> file is reported as missing the required <urlset> root element. Validate each child sitemap individually instead.
Should sitemap URLs include trailing slashes?⌄
Use whatever canonical form your server returns — with or without trailing slash — and be consistent. The canonical URL in your sitemap should match the canonical in your page's <link rel="canonical"> tag, otherwise Google may see a mismatch and prefer one version over the other.
How do I fix a sitemap that Search Console reports as 'could not be read'?⌄
Start by pasting the sitemap content into this validator to catch XML parse errors such as unclosed tags or unencoded ampersands. Then check the parts this tool does not cover: the namespace declaration, a byte order mark (BOM) at the start of the file, and the HTTP response your server returns.
Glossary
- Sitemap Protocol 0.9
- The XML-based protocol defined at sitemaps.org and adopted by Google, Bing, and Yahoo for communicating URL lists and metadata to search engine crawlers.
- Sitemap Index
- An XML file that lists multiple child sitemap files rather than individual URLs, used when a site's URL count exceeds the 50,000-URL single-sitemap limit.
- lastmod
- An optional <lastmod> element within a sitemap URL entry indicating the date the page was last significantly modified, in W3C Datetime (ISO 8601) format.
- changefreq
- An optional sitemap element suggesting how frequently a URL's content changes. Valid values are always, hourly, daily, weekly, monthly, yearly, and never.
- XML Entity Encoding
- The substitution of special XML characters with entity references (& for &, < for <, > for >) so XML parsers do not misinterpret them as markup.
- W3C Datetime
- A profile of ISO 8601 used by the Sitemap Protocol for lastmod values, supporting formats from YYYY to YYYY-MM-DDThh:mm:ss+TZ, requiring at minimum a full YYYY-MM-DD date.
A LITTLE HELP. A LOT DONE.
Good tools.
Great flow.
Your shortcut to the everyday. Create, convert, calculate,
and get back to what you love.
✳
✳
✓ Free to use✓ No sign-up✓ 500+ possibilities