# XML Sitemap Generator

> Paste a list of pages and copy a clean sitemap.xml, or paste an existing sitemap and see every error with its line number.

- Page: https://codethatmoves.com/tools/seo/xml-sitemap-generator/
- Site: Code That Moves
- Category: SEO and AI search
- Free, runs in the browser, nothing is uploaded (files you drop in stay on your device)
- Last checked: 2026-11-03

## What it does

- Reads full URLs, root paths with a base URL, HTML with links, prose, an old sitemap (its lastmod dates kept) or a crawler/CMS CSV export (the URL column and a date column are picked out); paste or open a .txt, .csv or .xml file
- Normalises every URL: trims, drops #fragments, keeps or changes the trailing slash (never on URLs with a query), percent-encodes spaces and non-ASCII, punycodes hosts and removes duplicates
- Keeps one host and lists the URLs it dropped from other hosts, and warns about http and https mixed on one site and utm_ tracking tags
- Optional lastmod (today, a chosen date, or a date after each URL), and optional changefreq and priority, off by default
- Escapes &, <, >, ' and " so the XML stays valid
- Over 50,000 URLs or 50 MB, splits into numbered files with a sitemap index and downloads them all as one zip
- Validator for urlset and sitemapindex files: namespace, loc, lastmod, changefreq, priority, duplicates, hosts, limits and broken XML, plus image:loc and hreflang xhtml:link values, each with line numbers
- Download sitemap.xml or a gzipped sitemap.xml.gz, and open .xml.gz files in the validator; compression runs in the browser
- Copy, download or share the settings and list as a link

## How to use it

1. Paste your pages, one per line, or open a URL list or crawler export. Full URLs work as they are; for paths like /about/ fill in the Base URL. A date after a URL on the same line (/blog/post/, 2026-10-01) becomes its lastmod.
2. Leave the trailing slash as typed, or pick the style your site redirects to, and choose whether to add lastmod. Leave changefreq and priority out unless another tool needs them.
3. Read the checks under the output, then copy or download sitemap.xml. With more than 50,000 URLs, download the zip and upload every file.
4. Put the file at the site root, add a Sitemap: line to robots.txt and submit it in Search Console. Use Validate to check any sitemap you already have.

## What it checks and why

A sitemap is an XML file that lists the URLs you want search engines to find. The format comes from sitemaps.org: a urlset element in the namespace http://www.sitemaps.org/schemas/sitemap/0.9, one url element per page, and a loc in each with the full URL including the protocol. The file must be UTF-8, and characters like & in a URL have to be written as entities (&amp;), which is the most common reason a hand-made sitemap fails to parse.

One file may hold at most 50,000 URLs and 50 MB uncompressed. Past that you split the list into several files and list them in a sitemap index, a sitemapindex element with one sitemap entry per file. Google lets you submit the index once instead of every file.

Google uses lastmod when it is consistently and verifiably accurate, so set it to the date the main content last changed, not today's date on every page. Google ignores changefreq and priority, which is why the tool leaves them out unless you switch them on.

List only canonical URLs that return 200: one host, one protocol, the trailing slash form your site redirects to, and no tracking parameters. Google says a sitemap should list URLs from the same site it is hosted on unless cross-site submission is set up, so the generator keeps one host and tells you what it dropped.

## Specs and sources

- [sitemaps.org: Sitemaps XML format](https://www.sitemaps.org/protocol.html)
- [Google Search Central: Build and submit a sitemap](https://developers.google.com/search/docs/crawling-indexing/sitemaps/build-sitemap)
- [Google Search Central: Manage your sitemaps with sitemap index files](https://developers.google.com/search/docs/crawling-indexing/sitemaps/large-sitemaps)
- [Google Search Central blog: Sitemaps ping endpoint is going away (lastmod, changefreq and priority)](https://developers.google.com/search/blog/2023/06/sitemaps-lastmod-ping)
- [W3C: Date and Time Formats (W3C Datetime)](https://www.w3.org/TR/NOTE-datetime)

## Limits

- It does not crawl your site: that would need a server. Paste a URL list from your CMS, a crawler export or your router instead.
- It cannot tell whether a URL returns 200, redirects or is noindex. Check that in Search Console or with a crawler before you publish.
- Image, video, news and hreflang extensions are not generated. The validator checks their namespace prefixes, image:loc URLs and xhtml:link attributes, but not video or news fields.
- In a CSV line, a comma or semicolon separates columns, so a URL that contains one should be percent-encoded (%2C, %3B) or pasted on its own line without other columns.

## Questions

### How do I create an XML sitemap?

List the canonical URLs of the pages you want indexed, wrap each in a url and loc element inside a urlset with the sitemaps.org namespace, and save it as UTF-8. This tool does the wrapping and escaping from a pasted list.

### How many URLs can a sitemap have?

50,000 URLs and 50 MB uncompressed per file. For more, split the URLs into several sitemaps and list them in a sitemap index file.

### Where do I put sitemap.xml?

Usually at the site root, e.g. https://example.com/sitemap.xml, because a sitemap should only list URLs at or below its own folder. Then add Sitemap: https://example.com/sitemap.xml to robots.txt and submit it in Search Console.

### Does Google use priority and changefreq?

No. Google has said it ignores both. It uses lastmod when the dates are consistently accurate.

### Why does my sitemap say it has an error on a line with &?

In XML a bare & starts an entity, so a URL like ?a=1&b=2 must be written ?a=1&amp;b=2 inside loc. The validator points at every unescaped & with its line number.

### Should I put lastmod on every URL?

Only when you know the real date the page's main content changed. A lastmod that always says today teaches Google to ignore it.

### Can I make a sitemap without crawling my site?

Yes. Export the URL list from your CMS, a crawler such as Screaming Frog, or your static site's routes, and paste or open it here. The URL column of a CSV export is picked out, so there is no page limit and nothing is fetched.

### What is the difference between a sitemap and a sitemap index?

A sitemap (urlset) lists page URLs, up to 50,000 per file. A sitemap index (sitemapindex) lists sitemap files instead of pages, so a large site submits one index that points at all its sitemaps.

### Can I gzip my sitemap?

Yes. sitemaps.org allows gzip-compressed sitemaps such as sitemap.xml.gz; the 50 MB limit applies to the uncompressed file. Use Download .gz, and open .gz files directly in the validator.
