Quick answer: An XML sitemap is a file that lists the URLs on your site you want search engines to crawl. To create one, list your public, canonical URLs, wrap each in a loc element inside a urlset, save it as sitemap.xml at the root of your site, and submit it in Google Search Console. A sitemap helps discovery but does not guarantee that every listed page will be indexed.
Try the free XML Sitemap Generator
Free, no sign-up, and built by the author of this guide.
Open the XML Sitemap GeneratorWhat an XML sitemap contains
The format is defined by the Sitemaps XML protocol, which Google, Bing and other search engines support. A minimal valid sitemap looks like this:
<?xml version="1.0" encoding="UTF-8"?> <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"> <url><loc>https://example.com/</loc></url> </urlset>
<urlset>wraps the file and declares the protocol namespace.<url>holds one entry, and<loc>holds the full, absolute URL.<lastmod>is optional and records when the page last changed. The protocol also defines<changefreq>and<priority>, but Google Search Central says Google ignores both and useslastmodonly when it is consistently accurate.
The file must be UTF-8 encoded, and special characters in URLs must be escaped, for example & as &.
Size limits and sitemap index files
A single sitemap may contain at most 50,000 URLs and must be no larger than 50 MB (52,428,800 bytes) uncompressed. These limits come from the sitemaps.org protocol and are repeated in Google's documentation. If your site is larger, split the URLs across several sitemaps and list them in a sitemap index file, which uses <sitemapindex> and <sitemap> elements instead of <urlset> and <url>. You can submit the index file and search engines will read each sitemap it lists.
How to use the free XML Sitemap Generator
- Paste your URLs into the URLs, one per line box. Each line must be a complete address starting with
http://orhttps://. - Click Generate XML sitemap.
- Review the output. Lines that are not valid HTTP or HTTPS URLs are left out without a warning, so compare the number of entries with your list.
- Click Copy result, paste the XML into a text editor and save it as
sitemap.xmlwith UTF-8 encoding. - Upload the file to the root of your site, for example
https://example.com/sitemap.xml.
The generator produces <loc> entries only. It does not crawl your site, add lastmod dates, remove duplicates or split large lists into several files, so clean your list first and add lastmod by hand if you track change dates.
A lastmod value uses the W3C Datetime format, for example <lastmod>2026-10-25</lastmod> placed inside the <url> element after <loc>. Change it only when the main content of the page changes, not when a footer or sidebar is updated, so that search engines can keep trusting the dates.
Worked example
A small static site has a home page, an about page, a services page and one case study. Paste these four lines:
https://example.com/ https://example.com/about https://example.com/services https://example.com/case-studies/cloud-migration
The generator returns:
<?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></url> <url><loc>https://example.com/services</loc></url> <url><loc>https://example.com/case-studies/cloud-migration</loc></url> </urlset>
If one line had been example.com/contact without the scheme, it would have been dropped, leaving three entries instead of four.
Submitting the sitemap
- robots.txt: add a line such as
Sitemap: https://example.com/sitemap.xml. Any crawler that reads robots.txt can then find it. - Google Search Console: open the Sitemaps report for your property, enter the sitemap URL and submit it. The report shows whether Google could read the file and how many URLs it found.
- Bing Webmaster Tools: submit the same URL in its sitemaps section if you use it.
Submitting a sitemap is a hint, not a command. Search engines still decide which pages to crawl and index.
Common mistakes
- Listing URLs that redirect, return errors or are blocked. Include only pages that return 200 and are allowed in robots.txt.
- Including non-canonical URLs. List the version you want indexed, not copies with tracking parameters or alternate paths.
- Mixing hosts or protocols. Use the same scheme and host throughout, such as
https://example.com, rather than a mix ofhttp,wwwand non-wwwURLs. - Placing the file in a subfolder. A sitemap generally covers only URLs at or below its own location, so a file in
/blog/should not list pages outside that folder. Put it at the root. - Letting it go stale. Regenerate the sitemap when you add or remove pages.
Frequently asked questions
How many URLs can one sitemap contain?+
Up to 50,000 URLs and 50 MB uncompressed. Larger sites should use several sitemaps listed in a sitemap index file.
Do I need a sitemap for a small website?+
Google Search Central says a small site that is well linked internally may not need one, but a sitemap is easy to create and can help new pages get discovered.
Does Google use priority and changefreq?+
No. Google says it ignores priority and changefreq. It uses lastmod when the dates are consistently accurate.
Where should I put sitemap.xml?+
At the root of the site, for example https://example.com/sitemap.xml, and reference it in robots.txt.
Does a sitemap guarantee indexing?+
No. It helps search engines discover URLs, but they still decide which pages to crawl and index.
Try the free XML Sitemap Generator
Put this guide into practice in your browser.
Open the XML Sitemap Generator