Xerobit

XML Sitemap Validator: Check Your Sitemap Against the Rules

This xml sitemap validator checks your sitemap XML against the official sitemaps.org protocol. Paste your file to verify well-formedness, required elements, URL format, date syntax and size limits. The sitemap xml validator runs entirely in your browser so nothing is uploaded to any server.

Result

Your sitemap is valid according to the sitemaps.org protocol.
  • Status
    Valid
  • Type
    urlset
  • Entries
    1
  • File size
    162 B

    Limit is 50 MB uncompressed

How to use the xml sitemap validator

  1. Copy the contents of your sitemap.xml file.
  2. Paste the XML into the text area above.
  3. The sitemap validator checks structure, tags and limits automatically as you type.
  4. Review the summary for errors, warnings and entry counts.

What this xml sitemap validator checks

This tool acts as a comprehensive sitemap xml validator by enforcing every rule from the sitemaps.org protocol. It first reads the file with a built-in XML parser to confirm it is well-formed (matching tags, escaped ampersands, legal characters and a declared namespace), then applies the sitemaps.org rules to each entry.

The checks include verifying that the root element is either <urlset> or <sitemapindex>, that every entry contains a required <loc> tag, and that all URLs are absolute and begin with http:// or https://. It also validates optional fields like <lastmod>, <changefreq> and <priority> against their allowed formats and ranges, checks the element order the schema requires (loc, lastmod, changefreq, priority) and the xmlns namespace. It does not request the URLs, so it cannot tell you whether a page returns 200, and it does not expand custom DTD entities.

Sitemaps.org limits and rules

The official protocol enforces strict limits to keep files manageable for search engines. A single sitemap file must not exceed 50,000 URLs and must be no larger than 50 MB (52,428,800 bytes) uncompressed. If your site exceeds these thresholds, you must split the content across multiple files and reference them using a sitemap index.

RuleLimit
Maximum URLs per file50,000
Maximum file size50 MB (uncompressed)
URL schemehttp:// or https:// only
Priority range0.0 to 1.0
Changefreq valuesalways, hourly, daily, weekly, monthly, yearly, never

This xml sitemap validator checks all of these constraints and reports exactly which rule was violated if an issue is found. Empty files, a missing namespace and a declared encoding other than UTF-8 are also reported as errors.

Date formats for lastmod

The <lastmod> tag must use W3C Datetime encoding. In practice that means a complete date like 2024-01-15 or a full timestamp such as 2024-01-15T14:30:00+00:00. The month must be between 01 and 12, and the day must be valid for that month, so 2024-02-30 is an error. Shorter W3C forms such as 2024-06 or a time without seconds are reported as warnings, because the official sitemaps.org schema does not accept them.

A common mistake is using Unix timestamps or non-standard formats like 01/15/2024. Malformed dates give crawlers nothing useful, which defeats the purpose of providing them. The sitemap validator flags any <lastmod> value that does not strictly match the W3C specification.

Common sitemap mistakes

When running a sitemap xml validator, developers frequently encounter a few recurring issues. Duplicate URLs are among the most common. Including the same <loc> twice is redundant and wastes crawler effort. This tool lists duplicates as a warning, since the schema itself does not forbid them.

Another frequent error is using relative URLs like /about instead of absolute ones like https://example.com/about. The protocol requires the full scheme and domain. Additionally, placing HTML entities or unescaped ampersands inside <loc> tags breaks XML well-formedness. If you need to inspect the raw tree structure, you can use an xml viewer to visualize the document before validating it.

Sitemap index vs URL set

A sitemap file uses one of two root elements. A <urlset> contains individual page entries wrapped in <url> tags. A <sitemapindex> contains references to other sitemap files wrapped in <sitemap> tags. You cannot mix both types in a single document.

If you need to create a new file from scratch, consider using a sitemap generator to ensure the initial structure is correct. Once generated, paste the output into this xml sitemap validator to confirm it meets all requirements before submitting it to search consoles. For general XML syntax checking outside of sitemaps, a standard xml validator handles arbitrary schemas.

Worked examples

ExampleInputResult
Valid urlsetSitemap XML: <?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-01-15</lastmod> / <changefreq>weekly</changefreq> / <priority>0.8</priority> / </url> / </urlset>Status: Valid; Type: urlset; Entries: 1; File size: 261 B
Valid sitemap indexSitemap XML: <?xml version="1.0" encoding="UTF-8"?> / <sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"> / <sitemap> / <loc>https://example.com/sitemap1.xml</loc> / <lastmod>2024-06-01T12:00:00Z</lastmod> / </sitemap> / </sitemapindex>Status: Valid; Type: sitemapindex; Entries: 1; File size: 238 B
Duplicate URLsSitemap XML: <?xml version="1.0" encoding="UTF-8"?> / <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"> / <url><loc>https://example.com/a</loc></url> / <url><loc>https://example.com/a</loc></url> / </urlset>Status: Valid; Type: urlset; Entries: 2; File size: 201 B

FAQ

What is an xml sitemap validator?

An xml sitemap validator is a tool that checks whether a sitemap file follows the sitemaps.org protocol. It verifies required tags, URL formats, date syntax and file size limits to ensure search engines can read the file correctly.

How many URLs can a sitemap contain?

A single sitemap file can contain up to 50,000 URLs. The uncompressed file size must also remain under 50 MB. If you exceed either limit, you must split the URLs into multiple files and link them via a sitemap index.

Does this sitemap xml validator upload my data?

No. The validation logic runs entirely in your browser using JavaScript. Your XML is never sent to any server, keeping your site structure private.

What date format does lastmod require?

The lastmod tag requires W3C Datetime format. Acceptable examples include 2024-01-15 for a date only, or 2024-01-15T14:30:00+00:00 for a full timestamp with timezone offset.

Can I validate a sitemap index with this tool?

Yes. The sitemap validator supports both urlset files containing page URLs and sitemapindex files containing links to other sitemaps. It applies the appropriate rules based on the root element detected.

Why are duplicate URLs a problem in sitemaps?

Duplicate entries are not forbidden by the schema, but they waste crawler effort and can hide mistakes such as listing both the www and non-www version. This validator reports duplicate loc values as a warning so you can remove them.