XML Sitemap Generator and Validator
Operator: Abdulla Al Fahad. How tools are built and checked
A sitemap is one XML file until the list gets awkward: tracking parameters duplicate every product, a few rows point at another host, a lastmod is written as 3/1/25, and past 50,000 URLs the file has to be split and listed in an index. Crawlers and paid generators handle this, often with a URL cap on the free tier, and usually begin by crawling your site.
This tool starts from a list you already have. Paste URLs, or open a CSV from a CMS, a database query or a crawler export, and it normalises the addresses, removes duplicates, checks each row against the sitemap protocol, and writes the files. Past 50,000 URLs or 50 MB it splits the output and builds a sitemap index. It does not crawl a website; if you do not have the list yet, export it from your platform or a crawler first. A second panel checks an existing sitemap, including one you open as .xml.gz.
Key features
- Plain URL lists (one per line, # for comments) or CSV with url, lastmod, changefreq, priority, images and alternates columns, in any order and under common aliases such as loc or last_modified
- Normalisation: force https, keep, add or remove trailing slashes, strip utm_*, fbclid, gclid and similar tracking parameters, drop fragments, resolve paths such as /about against a site URL
- Row checks: same host, absolute http or https, no spaces or credentials, length up to 2,048 characters, W3C-format lastmod, priority from 0.0 to 1.0, valid changefreq, and hreflang codes
- Duplicate rows merged into one entry (the later lastmod wins and images are combined); every skipped row reported with its line number
- Image entries (up to 1,000 per page) and xhtml:link hreflang alternates written with the right namespaces
- Splitting at 50,000 URLs or 52,428,800 bytes per file, with a sitemap index that needs the address where the files will be hosted
- Optional gzip through CompressionStream, a ZIP of everything, and a validator for a pasted sitemap, sitemap index or .xml.gz file
Protocol limits, the CSV columns and what the validator checks
The sitemap protocol allows up to 50,000 URLs and 50 MB (52,428,800 bytes) uncompressed per file, and a sitemap index may list up to 50,000 sitemaps. Only the loc element is required in each url entry. Google documents that it ignores priority and changefreq and uses lastmod only when it is consistently accurate, so a bare list of canonical URLs with an honest lastmod is a fine sitemap. The tool lets you add the other fields because other consumers read them, but it does not suggest they help your rankings.
Every URL in one sitemap must be on the same host, and www.example.com and example.com count as different hosts. The tool fixes the host from the Site URL field, or from the first valid URL if you leave it blank, and skips any row that differs with a message naming both hosts. Protocol-relative URLs and paths beginning with a slash need the Site URL, because there is nothing to resolve them against. Ampersands and other XML special characters in a URL are escaped as entities in the output, which is what the protocol requires.
lastmod must be a W3C datetime: YYYY, YYYY-MM, YYYY-MM-DD or a date with a time and a zone such as 2025-03-01T09:30:00+00:00. A value that fails the pattern or names an impossible date is dropped with a warning, and the URL is still written. Alternates in the CSV are written pair by pair as lang=url, separated by a vertical bar, and each one becomes an xhtml:link element on the page's entry. Remember that hreflang needs the full set listed on every page of a cluster; the focused hreflang generator on this site checks reciprocity.
Splitting happens on whichever limit is reached first. Each file is built as text, its byte length measured in UTF-8, and a new file is started before either limit would be crossed. The index lists each file with the largest lastmod it contains. Because the index must contain absolute addresses, the page asks for the folder where the files will live, such as https://example.com/sitemaps/; it defaults to the site root, and it will not build the index from an address that is not a valid http or https URL. The index is saved as sitemap-index.xml. When gzip is on, files are named sitemap-1.xml.gz and so on, and the index points at those names; the 50 MB limit still applies to the uncompressed size.
How it works
The input is read as a CSV if the first row contains a url or loc header, otherwise as a list. Rows are normalised and validated one at a time, and the result is rebuilt whenever the input or an option changes; the file list is marked stale until you press Generate again so downloads never carry an old version. The validator uses a small strict XML reader with line numbers rather than the browser's DOM parser, so reports point to the line in the file, and DOCTYPE declarations are refused, which also closes the door on entity-expansion tricks in pasted XML.
Typical uses
- Turning a 120,000-row product export into three sitemap files and an index after stripping UTM parameters
- Adding hreflang alternates for translated pages to an existing list of URLs
- Checking whether an existing sitemap.xml.gz stays within the protocol limits before submitting it in Search Console
Building one
- Paste the URLs, or open a .csv or .txt file; fill in the Site URL if any rows start with a slash or you want to fix the host.
- Set the options: https, trailing slash style, tracking removal and any default lastmod, changefreq or priority.
- Press Generate and read the messages: skipped rows are errors, dropped optional values are warnings.
- If the result has more than one file, enter where the files will be hosted so the index can be built, choose gzip if you want it, and download the files or the ZIP.
- To check an existing sitemap, paste its XML or open the file in the second panel.
Example
Five rows, site https://example.com
url,lastmod,changefreq,priority,alternates
https://example.com/?utm_source=news,2025-03-01,daily,1.0,
https://example.com/pricing/?utm_medium=email,2025-02-10,,0.8,fr=https://example.com/fr/tarifs/|en=https://example.com/pricing/
https://example.com/pricing/,2025-02-11,,,
https://other.com/blog/,2025-01-01,,,
/about,not-a-date,,,Result with default changefreq weekly
3 URLs in sitemap.xml:
/ (lastmod 2025-03-01, daily, 1.0)
/pricing/ (lastmod 2025-02-11, weekly, 0.8, fr and en alternates)
/about (no lastmod, weekly)
Messages: line 4 merged into line 3 as a duplicate; line 5 skipped (host other.com differs from example.com); line 6 lastmod droppedTips for best results
- List only canonical, indexable URLs. A sitemap full of redirected, noindex or parameter variants wastes the crawl signal it exists to give.
- Leave lastmod out rather than filling it with today's date. Search engines learn to ignore a value that changes on every build.
- Use one sitemap per host and per protocol. If your site answers on both www and the bare domain, list only the one that is canonical.
- For a multilingual site, generate the sitemap with alternates in the same pass instead of editing the XML later.
Things to check before you rely on it
This does not crawl. It writes what you give it, and it cannot tell you which URLs exist on your site or whether they return 200.
Priority and changefreq are written only if you ask for them. Google ignores both, so do not spend time tuning them for search.
A host mismatch is skipped, not rewritten. If many rows are skipped for the host, check whether the list uses www, a staging domain or http where the Site URL does not.
A sitemap normally lives on the host it describes. Cross-host submission is possible, through a Sitemap line in robots.txt or after proving ownership of both sites in Search Console, but generating the files here does not publish anything.
Common errors and how to fix them
- "Skipped: the host other.com differs from example.com"
- Fix the row, or change the Site URL if the first host was the wrong one. A sitemap cannot list URLs from another host.
- "A path such as /about needs the Site URL field filled in"
- Type the site address, for example https://example.com, in the Site URL field so relative paths can be resolved.
- "lastmod dropped: Use YYYY-MM-DD ..."
- Change the date to YYYY-MM-DD or to a full date and time with a zone, such as 2025-03-01T09:30:00+00:00. Formats like 3/1/2025 are not valid.
- The sitemap index cannot be built
- Fix the field labelled Base URL where you will upload the files: it must be an absolute address starting with http:// or https://.
Best practices
- Run the validator on the final files, or on the live sitemap after deployment, and fix errors before submitting it.
CSV columns
Only url is required. The reader recognises url, loc, location and address for the address; lastmod, last_modified and modified for the date; changefreq, change_frequency and frequency; priority; images, image and image_urls, where several image URLs are separated by spaces or vertical bars; and alternates, alternate or hreflang, where each alternate is written lang=url and several are separated by vertical bars.
Semicolon- and tab-separated files are read as well as comma-separated ones. A row that has a lastmod or images but no URL is reported as an empty URL and skipped. Besides invalid values, the page also warns about a lastmod in the future, a list that mixes http and https for one host, and alternates that do not include the page itself.
Frequently asked questions
How many URLs fit in one sitemap?
At most 50,000 URLs and 50 MB uncompressed. Past either limit the tool starts a new file and builds a sitemap index, which can list up to 50,000 sitemaps.
Can it open a .gz sitemap?
Yes, in the validator panel. The browser's built-in decompression reads the file, and the size limit is checked against the uncompressed bytes. If your browser has no CompressionStream support, gzip output is switched off with a message.