Sitemap and robots.txt Generator
Turn a list of page addresses into a sitemap.xml file, and write a robots.txt file that points to it. Each address is checked before anything is written.
sitemap.xml
robots.txt
How to use
- Paste your page addresses into the URLs box, one per line. Add a last-modified date after a space if you want one, in the form YYYY-MM-DD.
- Optionally add robots.txt rules in the second box, one per line, each starting with
Allow:orDisallow:. - Press Generate. The tool checks every line and either explains the first problem it finds or fills in both files.
- Check the URL count and the size of sitemap.xml, then press Copy sitemap.xml and Copy robots.txt.
- Save the files as
sitemap.xmlandrobots.txtin the top folder of your site, so they are reachable at the root of the domain.
Worked example
Enter these three lines in the URLs box, and the two rules under it:
https://example.com/
https://example.com/about 2026-01-15
https://example.com/search?q=a&b=2
Disallow: /admin/
Disallow: /tmp/
The tool reports three URLs and 297 bytes, and writes this sitemap:
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url><loc>https://example.com/</loc></url>
<url><loc>https://example.com/about</loc><lastmod>2026-01-15</lastmod></url>
<url><loc>https://example.com/search?q=a&b=2</loc></url>
</urlset>
The ampersand in the third address is written &, as XML requires. The robots.txt starts with User-agent: *, lists both Disallow rules, and ends with three Sitemap: lines, one per address. A line such as /about is refused, because it is relative, and a date such as 2026-02-30 is refused because it is not a real day.
How it works
sitemap.xml follows the sitemaps.org protocol. The file starts with an XML declaration and a urlset element in the namespace http://www.sitemaps.org/schemas/sitemap/0.9. Each address becomes one url element with a loc, and a lastmod when you add a date. The date must be a real calendar date in the W3C form YYYY-MM-DD. The characters & < > " and ' are escaped in every value, so an ampersand in a URL is written as & in the file.
Limits. A sitemap file holds at most 50,000 URLs, and at most 52,428,800 bytes (50 MB) uncompressed. Each URL is at most 2048 characters. A longer list must be split into several sitemap files.
URL checks. Each address must be absolute, start with https:// or http://, and contain no spaces. Relative addresses such as /about are refused, because a sitemap needs the full address.
robots.txt follows RFC 9309, the Robots Exclusion Protocol. The file starts with a User-agent line (here *, which means every crawler). Each Allow or Disallow rule is written as you entered it, and its path must start with /. After a blank line, the file gets one Sitemap line for each URL in the list, as the sitemaps.org protocol describes.
robots.txt is a request, not a lock. Crawlers that follow the standard read it, but it does not stop anyone from opening a page. Do not rely on it to hide private content.
Common mistakes
- Listing pages that are blocked or redirected. A sitemap should hold the final, indexable address of each page. Do not list URLs that redirect, return errors or carry a noindex tag.
- Mixing hosts and schemes. A sitemap should only list addresses on the same site, with the same scheme and host. Mixing http and https, or www and non-www, confuses crawlers.
- Disallowing the sitemap by accident. A broad rule such as
Disallow: /asks every crawler to stay away from the whole site. - Using robots.txt to hide pages. The file is public, so listing a secret folder advertises it. Use authentication instead.
- Putting a fake lastmod on every page. Use the date the content really changed, or leave it out. Search engines learn to ignore dates that never match reality.
Frequently asked questions
Where do I put the files?
At the root of the host, for example https://example.com/sitemap.xml and https://example.com/robots.txt. A robots.txt in a subfolder is ignored.
Do I need a sitemap?
A small site that is well linked is usually found without one. A sitemap helps most with large sites, new sites and pages that are hard to reach by links.
Are priority and changefreq included?
No. The protocol allows them, but Google has said it ignores both, so the tool writes only loc and lastmod.
What if I have more than 50,000 pages?
Split the list into several sitemaps and point to them from a sitemap index file. The protocol describes that format.
Are my URLs uploaded?
No. Both files are made in your browser, and nothing is stored.
Related tools
- Meta Tag and Open Graph Generator for the tags on each listed page.
- URL Parser and Query Builder to check that an address is well formed.
- Diff Checker to compare an old sitemap with a new one.