WebToolsPlanet
seo Tools

Sitemap Validator

Validate XML sitemaps for syntax errors, structure issues, and SEO best-practice compliance.

Last updated: March 25, 2026

Client-Side Processing
Input Data Stays on Device
Instant Local Execution

Find this tool useful? Support the project to keep it free!

Buy me a coffee

What 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

1

Paste your sitemap XML content directly into the editor, or enter your sitemap URL to fetch it

2

Click "Validate" to run the full validation check

3

Review the results: errors (blocks indexing), warnings (best-practice issues), and info messages

4

Fix identified errors in your sitemap generator or CMS sitemap plugin

5

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:

Valid sitemap.xml structure
<?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>
Validation result
✅ 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?
In Google Search Console, go to Index → Sitemaps, enter your sitemap URL (e.g. https://example.com/sitemap.xml), and click Submit. Google will attempt to fetch and parse it. If there are errors, they will appear in the Sitemaps report. You can also declare your sitemap in robots.txt with "Sitemap: https://example.com/sitemap.xml" — this is a best practice.
What is a sitemap index file?
A sitemap index is a sitemap that references other sitemaps. Used when you have more than 50,000 URLs (the per-sitemap limit) or want to organize sitemaps by type (posts-sitemap.xml, pages-sitemap.xml, products-sitemap.xml). The index file uses <sitemapindex> as the root element instead of <urlset>, and each entry uses <sitemap><loc>...</loc></sitemap>. This validator supports both formats.
Should I include all pages in my sitemap?
No — only include canonical, indexable pages. Exclude: pages with noindex tags, paginated pages (except page 1), filtered/sorted URLs with query parameters, login/admin pages, thank-you pages, and pages that are disallowed in robots.txt. Only include pages you want Google to discover and rank. Including thin or non-canonical pages wastes crawl budget.
Does Google really use changefreq and priority?
Google officially states it largely ignores changefreq and priority — they find these values are unreliable indicators of actual update frequency and importance. Focus on the lastmod date (use accurate dates from your CMS) and on actually having quality content. Lastmod IS used by Google to determine when to recrawl — keep it accurate.
What is the maximum number of URLs in a sitemap?
Each sitemap file is limited to 50,000 URLs and 50MB uncompressed (10MB compressed). For larger sites, use a sitemap index file that references multiple sitemap files. Most CMS plugins (Yoast, Rank Math) handle this automatically.
Why does XML encoding matter and what is a UTF-8 BOM issue?
XML requires UTF-8 encoding and the declaration must be the very first content in the file. A UTF-8 BOM (Byte Order Mark — an invisible character some editors add) before the XML declaration breaks the parser. This is the #1 cause of "sitemap could not be read" errors in Search Console. This validator detects BOM characters.

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

Browser DOMParser APISitemap Protocol (sitemaps.org)XML ValidationClient-side onlyNo external dependencies