All Tools490+

XML Sitemap Validator – Check Sitemap Errors in 3 Easy Steps

XML Sitemap Validator

Paste raw code into this XML sitemap validator to instantly audit structure, missing tags, and URL counts locally.

Raw XML Code
Validation Report
--
XML Syntax Status
--
Sitemap Type
0
Total URLs/Indexes
Detailed Audit Log
    This validator uses local browser DOM Parsing. Your XML data is processed securely on your device and is never transmitted externally.
    Report copied to clipboard! ✓

    Use this free XML sitemap validator to check a sitemap before you submit it to Google Search Console. Paste the raw XML, press Validate Sitemap, and the tool checks the syntax, the root element, the number of URLs, missing <loc> tags, relative or broken URLs, invalid lastmod dates and duplicate URLs.

    Quick answer

    A valid XML sitemap starts with <urlset> (or <sitemapindex> for an index), uses the sitemaps.org namespace, and gives every <url> a <loc> with a full absolute URL. Dates in <lastmod> must use W3C format such as 2026-10-23. One sitemap can hold up to 50,000 URLs and 50 MB uncompressed.

    A sitemap tells search engines which pages you want crawled. If it has XML errors, relative URLs or fake dates, Google may ignore parts of it or report errors in Search Console.

    This XML sitemap validator reads the file in your browser and lists every problem with the item number, so you can find and fix it fast.

    What the Sitemap Validator Checks

    CheckResultWhy it matters
    XML syntaxFAIL if brokenOne unclosed tag stops the whole file from being read.
    Root elementurlset or sitemapindexAny other root is not a valid sitemap.
    Item countTotal URLs or sitemapsShows the size and flags files over 50,000 URLs.
    <loc> presentFAIL if missingEvery entry needs a URL.
    Absolute URLsFAIL if relativeSitemaps must use full http or https URLs.
    lastmod formatFAIL if invalidDates like 2026-13-40 are rejected.
    Duplicate URLsWARNDuplicates waste crawl attention and suggest a generator bug.

    How to Use the XML Sitemap Validator

    Step 1: Paste Your Raw XML Code

    Open your sitemap in a browser, for example yoursite.com/sitemap.xml, view the source and copy everything into Raw XML Code. Our test sitemap has five entries with a few planted mistakes.

    Step 1 paste sitemap code into the XML sitemap validator

    Step 2: Validate and Check the Summary

    Press Validate Sitemap. The summary shows VALID XML syntax, the sitemap type (Standard Sitemap) and 5 total URLs. Valid syntax means the file parses, but you still need to read the audit log for content errors.

    Step 2 XML sitemap validator summary with 5 URLs

    Step 3: Fix the Errors in the Audit Log

    The Detailed Audit Log lists each issue. Here it flags the relative URL /about/ at item 3, a missing <loc> at item 4, the impossible lastmod date 2026-13-40 and a duplicate cold-brew URL at item 5. Fix them in your generator or plugin, validate again and use Copy Report to share the audit.

    Step 3 XML sitemap validator audit log with relative URL, lastmod and duplicate errors

    Example of a Valid Sitemap

    <?xml version="1.0" encoding="UTF-8"?>
    <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
      <url>
        <loc>https://www.example.com/</loc>
        <lastmod>2026-10-01</lastmod>
      </url>
    </urlset>

    Sitemap Best Practices

    • Include only canonical, indexable pages that return 200 OK.
    • Leave out redirected, noindexed and duplicate URLs.
    • Update lastmod only when page content really changes. Google ignores dates that are always "today".
    • Split large sites into several sitemaps and list them in a sitemap index.
    • Add the sitemap URL to robots.txt and submit it in Search Console.
    • Google ignores the priority and changefreq tags, so you do not need them.

    Sitemap Index Files

    A sitemap index uses <sitemapindex> as the root and lists <sitemap> entries, each with a <loc> pointing to another sitemap file. WordPress SEO plugins usually create one index with separate sitemaps for posts, pages and categories. The validator detects both types automatically.

    Common Sitemap Problems in Search Console

    • Couldn’t fetch: the sitemap URL is blocked, redirects or returns an error. Open it in a browser first.
    • Sitemap is HTML: the URL returns a web page instead of XML, often because of a caching or security plugin.
    • Invalid date: a lastmod value is not in W3C format. The validator flags these lines.
    • URL not allowed: the sitemap lists URLs on a different domain or protocol than the sitemap itself.

    Run the XML sitemap validator after every plugin update or site migration, because those are the moments sitemaps most often break.

    More technical SEO tools: the Robots.txt Syntax Validator, the URL Canonical Tag Checker and the URL Redirect Chain Tracer.

    Frequently Asked Questions

    How do I check if my XML sitemap is valid?

    Copy the sitemap source into the XML sitemap validator and press Validate Sitemap. Fix every FAIL in the audit log, then validate again.

    Can a sitemap use relative URLs?

    No. Every loc must be a full absolute URL that starts with http:// or https://.

    What format should lastmod use?

    W3C Datetime, such as 2026-10-23 or 2026-10-23T14:30:00+05:00.

    How many URLs can one sitemap hold?

    Up to 50,000 URLs and 50 MB uncompressed. Use a sitemap index for more.

    Does Google use priority and changefreq?

    No. Google ignores both. Accurate lastmod dates are more useful.

    Is my sitemap uploaded?

    No. The XML sitemap validator parses the code in your browser and nothing is stored.

    MH

    Written and tested by Muhammad Hasnain

    Founder of VectraTools. Every example on this page was validated with the tool and checked against the sitemaps.org protocol and Google’s sitemap guidelines. Last reviewed: October 2026.