Sitemap Validator
Validate a sitemap XML file against the sitemaps.org protocol.
Validate a sitemap XML file against the sitemaps.org protocol. Detect missing loc, malformed lastmod, invalid changefreq, out-of-range priority, and size limits. Free, offline, runs entirely client-side. Read more Show less
What is a sitemap validator?
A sitemap is an XML file that lists the URLs of a website so that search engines can find and crawl them. The sitemaps.org protocol defines the exact format. A sitemap validator checks that your file follows that protocol, that every URL element has the required fields, that dates are in the correct format, and that values like priority and changefreq are valid.
Search engines are forgiving, but a broken sitemap can cause URLs to be silently skipped during crawling. This tool catches those problems before you submit the sitemap to Google or Bing.
How to use
Paste the XML content of your sitemap, or drop a .xml file into the drop zone. The tool parses it and reports:
Root element - must be <urlset> (a regular sitemap) or <sitemapindex> (an index of other sitemaps).
Namespace - must be http://www.sitemaps.org/schemas/sitemap/0.9.
Entries - every <url> (or <sitemap>) must have a valid <loc>.
Field validation - <lastmod> must be W3C datetime format. <changefreq> must be one of the allowed values. <priority> must be between 0.0 and 1.0.
Protocol limits
Sitemaps have two hard limits that search engines enforce:
50,000 URLs per file. If your sitemap has more, it will be rejected. Split into multiple sitemaps and use a <sitemapindex> to link them.
50 MB uncompressed. If the XML file exceeds 50 MB, split it. Sitemaps can be gzipped to .gz, but the uncompressed size still must not exceed 50 MB.
URL length. Each <loc> must not exceed 2,048 characters. Longer URLs may be ignored.
FAQ
Do I need a sitemap?
Google recommends one for any site with more than a few hundred pages, or for sites where internal linking does not reach every page. Small sites can get by without, but it never hurts to have one.
What is the difference between urlset and sitemapindex?
A urlset lists page URLs directly. A sitemapindex lists the locations of other sitemap files. Use an index when your site has more than 50,000 URLs or 50 MB of sitemap data - it is the standard way to split into multiple sitemaps.
What date format does lastmod require?
The W3C Datetime format. The most common form is YYYY-MM-DD (date only). You can also include a time: YYYY-MM-DDThh:mm:ss+00:00. Both are valid; the date-only form is simpler and what most sitemaps use.
What are valid changefreq values?
Always, hourly, daily, weekly, monthly, yearly, never. Search engines largely ignore this hint, but it must still be valid for the sitemap to pass schema validation.
Is priority important for SEO?
No. Google has explicitly stated that it ignores priority and changefreq. Both are legal in the format but have no effect. You can include them for clarity, or omit them to keep the sitemap smaller.
Should URLs include the trailing slash?
Include whatever your site actually serves. If your canonical URL has a trailing slash, the sitemap should too. Mismatches cause redirects which waste crawl budget.
Can a sitemap be gzipped?
Yes. Compress with gzip and name the file .xml.gz. Search engines accept this and prefer it for large sitemaps because it reduces bandwidth. The uncompressed content still must not exceed 50 MB.
Command line equivalent
# Submit to Google
# Use Search Console -> Sitemaps -> add your sitemap URL
# Submit to Bing
# Use Bing Webmaster Tools -> Sitemaps
# Validate locally
xmllint --noout sitemap.xml # check well-formed XML
xmllint --schema sitemap.xsd sitemap.xml # validate against the sitemaps.org schema
# (Download sitemap.xsd from https://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd)
# Python quick check
python3 -c '
import xml.etree.ElementTree as ET
tree = ET.parse("sitemap.xml")
root = tree.getroot()
ns = "{http://www.sitemaps.org/schemas/sitemap/0.9}"
urls = root.findall(ns + "url")
print(f"{len(urls)} URLs")
'
# Count URLs
grep -c "<loc>" sitemap.xml
# Gzip a sitemap
gzip -k sitemap.xml