Sitemap Validator
Validate XML sitemaps for syntax errors, structure issues, and SEO best-practice compliance.
Last updated: March 25, 2026
Find this tool useful? Support the project to keep it free!
Buy me a coffeeWhat is Sitemap Validator?
An XML sitemap is a structured file that lists all the important URLs on your website, along with optional metadata like last modification date (lastmod), update frequency (changefreq), and page priority (priority). It serves as a roadmap for search engine crawlers — telling Google, Bing, and others exactly which pages exist on your site and when they were last updated, so they can discover and re-crawl content more efficiently.
An invalid or malformed sitemap can prevent Google from indexing your pages correctly. Even minor issues — an extra character before the XML declaration, a URL that exceeds 2,048 characters, or an incorrect encoding declaration — can cause Google Search Console to report errors and reduce crawl efficiency. This tool validates your sitemap's XML structure, character encoding, URL format compliance, and adherence to the Sitemap Protocol specification (sitemaps.org).
How to Use Sitemap Validator
Paste your sitemap XML content directly into the editor, or enter your sitemap URL to fetch it
Click "Validate" to run the full validation check
Review the results: errors (blocks indexing), warnings (best-practice issues), and info messages
Fix identified errors in your sitemap generator or CMS sitemap plugin
Re-paste the corrected sitemap and validate again until all errors are resolved
Common Use Cases
- Diagnosing why Google Search Console shows sitemap errors or "Could not fetch" messages
- Validating a newly generated sitemap before submitting to Google Search Console
- Checking sitemap output from WordPress plugins (Yoast, Rank Math, All in One SEO)
- Validating sitemap index files that reference multiple sub-sitemaps
- Identifying encoding issues (UTF-8 BOM, special characters) that break sitemap parsing
- Checking that all URLs in the sitemap use canonical HTTPS and www/non-www consistently
- Pre-deployment validation as part of a CI/CD pipeline for JAMstack or Next.js sites
- Auditing competitor sitemaps for content discovery and SEO research
Example Input and Output
A minimal valid XML sitemap for a small website — this format is accepted by Google, Bing, and Yahoo:
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>https://example.com/</loc>
<lastmod>2024-03-25</lastmod>
<changefreq>weekly</changefreq>
<priority>1.0</priority>
</url>
<url>
<loc>https://example.com/about</loc>
<lastmod>2024-02-10</lastmod>
<changefreq>monthly</changefreq>
<priority>0.8</priority>
</url>
</urlset>✅ XML syntax: Valid
✅ Namespace declaration: Correct (sitemaps.org/schemas/sitemap/0.9)
✅ Encoding: UTF-8 declared
✅ URLs found: 2
✅ URL format: All URLs use HTTPS
✅ lastmod format: ISO 8601 (W3C datetime)
✅ Priority values: Within 0.0–1.0 range
No errors found. Sitemap is ready to submit to Google Search Console.Client-Side + Optional Fetch
Validation runs locally in your browser. If you provide a URL to fetch, the fetch request goes directly from your browser to the sitemap server — the file contents are not routed through or stored on our servers.
Google Search Console First
After correcting errors found here, submit your sitemap in Google Search Console for the most authoritative validation. GSC shows whether Google could successfully fetch and parse it, how many URLs were discovered vs submitted, and flags any URL-level indexing issues.
Compress Large Sitemaps
For sitemaps close to the 50MB limit, gzip compression is allowed and recommended. A 50MB uncompressed sitemap compresses to approximately 3-5MB. Serve it as sitemap.xml.gz with Content-Type: application/x-gzip. Google and all major search engines support gzipped sitemaps.
Frequently Asked Questions
How do I submit my sitemap to Google?
What is a sitemap index file?
Should I include all pages in my sitemap?
Does Google really use changefreq and priority?
What is the maximum number of URLs in a sitemap?
Why does XML encoding matter and what is a UTF-8 BOM issue?
How This Tool Works
The validator parses the sitemap XML using the browser's native DOMParser API, which builds a document object model that can be inspected for structural validity. It then runs a series of validation checks: XML well-formedness (DOMParser errors), root element (urlset vs sitemapindex), namespace URI, encoding declaration, URL format (protocol, length limits), lastmod date format (W3C ISO 8601), and priority range (0.0–1.0). Results are categorized as errors (spec violations), warnings (best-practice deviations), or info (informational counts). A UTF-8 BOM check is performed on the raw string before parsing.
Technical Stack