How to use XML Sitemap Validator
The XML Sitemap Validator checks remote sitemap files by fetching them server-side, then parsing structure and key protocol rules in a report you can act on quickly. Enter any public sitemap URL and the validator identifies whether it is a urlset or sitemapindex, counts entries, shows the first 50 URLs, lists child sitemap files, and flags common problems such as missing <loc> tags, invalid <lastmod> dates, wrong namespaces, or over-limit entry counts. Because the request runs through a guarded same-origin API route, browser CORS is never a blocker and private/local network targets are rejected for safety.
- Paste a full sitemap URL such as https://example.com/sitemap.xml into the input field.
- Click Validate to fetch and parse the XML through the ToolsHub API route.
- Review the detected type, URL count, and namespace summary cards.
- Inspect the first 50 URLs and child sitemap list to confirm expected coverage.
- Fix each reported issue and re-run the validator until no blocking errors remain.
What protocol checks matter most
A valid sitemap must use either a <urlset> root for page URLs or a <sitemapindex> root for child sitemap files, and it should declare the official namespace http://www.sitemaps.org/schemas/sitemap/0.9. Within each url or sitemap node, <loc> is mandatory and should contain an absolute URL. Optional <lastmod> values should be valid ISO-style dates so crawlers can trust freshness hints. Files should stay under 50,000 entries per document, and very large sites should split output by section then reference each child file from a sitemap index. These checks catch most real-world indexing failures before they reach production.
| Check | Expected rule | Failure example |
|---|---|---|
| Root element | urlset or sitemapindex | Custom root like <feed> |
| Namespace | http://www.sitemaps.org/schemas/sitemap/0.9 | Missing or incorrect xmlns |
| loc presence | Every entry has <loc> | URL block without loc |
| lastmod format | ISO date or datetime | Free-text date string |
| Entry limit | Maximum 50,000 entries | Single file exceeding limit |
Why server-side validation is useful
Many sitemap validators running in the browser fail because cross-origin requests are blocked by CORS. A same-origin server route solves this by fetching the sitemap on your behalf, then returning clean JSON to the widget. This also centralises safety controls: requests can be limited by timeout and size, redirects can be re-validated hop by hop, and local or private IP targets can be blocked to prevent SSRF abuse. The result is a validator that works on real production URLs without browser-network limitations while still enforcing strict security boundaries for your infrastructure.
Worked examples
Valid urlset sitemap
Inputs: https://example.com/sitemap.xml
Result: Type urlset, count 124, no issues, first 50 URLs listed
Sitemap index with one bad child entry
Inputs: index with 6 child sitemaps, one missing <loc>
Result: Type sitemapindex with issue: "Sitemap entry is missing a <loc> value"
Glossary
- urlset
- The sitemap root element used when listing canonical page URLs directly.
- sitemapindex
- A sitemap root element that points to multiple child sitemap files.
- loc
- Required sitemap element containing the absolute URL for a page or child sitemap file.
- lastmod
- Optional date or datetime element indicating when a URL or sitemap was last updated.
- SSRF
- Server-Side Request Forgery, an attack where untrusted URLs are used to access internal network resources.
Related reading
Frequently Asked Questions
Why use XML Sitemap Validator?
- CORS-free sitemap checks through a same-origin route handler with SSRF protections
- Detects sitemap type automatically and reports urlset versus sitemap index structure
- Surfaces practical issues: missing loc, invalid lastmod, namespace mismatches, and size-limit risks
- Lists child sitemap files and a preview sample of first URLs for fast QA
- Works with public sitemap URLs without requiring third-party validation services
Common use cases
- Validate a freshly deployed sitemap.xml before submitting it to Search Console
- Audit a sitemap index that references multiple section-level sitemap files
- Troubleshoot indexing delays caused by malformed lastmod values
- Confirm your CMS output still uses the official sitemap namespace after updates
- Spot over-limit files approaching the 50,000 URL protocol threshold
Get weekly tool tips & updates
New tools, power-user tips, and productivity hacks — delivered free every Friday.
No spam, ever. Unsubscribe with one click.
Related Developer Tools
Meta Tag Generator
Generate SEO, Open Graph, and Twitter Card meta tags from a simple form. Add your title, description, and image, then copy the ready-to-paste HTML for your head.
Code to Image Generator
Turn code snippets into clean, shareable PNG images. Paste your code, pick a theme, then download a picture for slides, docs, or social — free and private.
GraphQL Query Tester
Test GraphQL endpoints with query, variables, and headers, inspect data/errors, and explore introspection schema in-browser, with proxy fallback for CORS.
HAR File Viewer
Open and inspect HAR files in your browser with waterfall timing, filters, and per-request details to debug web performance and API behavior without uploads.
TOML ↔ JSON Converter
Convert TOML to JSON and JSON to TOML online. Paste a config file to transform it in either direction instantly. Free, private converter that runs in your browser.
XML Sitemap Generator
Generate a valid XML sitemap for your website. Add your URLs, set change frequency and priority, then download the sitemap.xml.
Explore all Developer Tools.