Home › Developer Tools › Sitemap and robots.txt Generator

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.

Enter one or more absolute URLs, then press Generate.
URLs in sitemap.xml-
Size of sitemap.xml (bytes)-

sitemap.xml

robots.txt

Everything runs in your browser. The URLs and rules you type are not sent anywhere and are not stored.

How to use

  1. 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.
  2. Optionally add robots.txt rules in the second box, one per line, each starting with Allow: or Disallow:.
  3. Press Generate. The tool checks every line and either explains the first problem it finds or fills in both files.
  4. Check the URL count and the size of sitemap.xml, then press Copy sitemap.xml and Copy robots.txt.
  5. Save the files as sitemap.xml and robots.txt in 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&amp;b=2</loc></url>
</urlset>

The ampersand in the third address is written &amp;, 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 &amp; 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

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