FREE TOOL · RUNS IN YOUR BROWSER

Free XML Sitemap Generator

Paste a list of URLs and build a valid sitemap.xml in one click — with optional priority, change frequency, and lastmod — ready to copy or download.

Sitemap inputs

Paste any list of page URLs — bare domains like example.com/page are upgraded to https:// automatically.

Example sitemap — paste your own URLs above to generate yours.
5 URLs
priority omittedchangefreq omittedlastmod omitted

sitemap.xml

<?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/blog</loc>
  </url>
  <url>
    <loc>https://example.com/blog/seo-guide</loc>
  </url>
  <url>
    <loc>https://example.com/contact</loc>
  </url>
</urlset>
The Complete Guide

XML Sitemaps Explained: How to Build and Submit a sitemap.xml

5 MIN READ

Understand with AI

Discuss with your preferred AI assistant

50,000
URLs per sitemap

The maximum number of URLs a single sitemap file may contain before you must split it.

50 MB
Max file size

A sitemap must stay under 50 MB uncompressed; larger lists need a sitemap index.

<loc>
Required tag

The only mandatory element per URL — the absolute address, including https://.

An XML sitemap is a simple file that lists the URLs you want search engines to crawl. It doesn't make pages rank by itself, but it removes a real obstacle: it tells Google, Bing, and other crawlers exactly which pages exist, so nothing important gets missed — especially on larger sites or pages that aren't well linked internally.

This guide explains what an XML sitemap is, when you actually need one, how to build a valid sitemap.xml in seconds, and how to submit it so search engines start using it.

What Is an XML Sitemap?

An XML sitemap is a machine-readable file, written in the sitemaps.org protocol, that lists the canonical URLs on your site. Each entry lives inside a <url> element with a required <loc> (the page address) and a few optional hints — <lastmod>, <changefreq>, and <priority>.

The whole document is wrapped in a single <urlset> tag with the official sitemaps.org namespace. A single sitemap can hold up to 50,000 URLs and must stay under 50 MB uncompressed; beyond that you split it into multiple sitemaps and reference them from a sitemap index file.

Why You Need a Sitemap (and When)

Search engines discover pages mainly by following links. A sitemap is your safety net for everything that discovery misses. You especially benefit when:

  • Your site is large — hundreds or thousands of pages are hard for crawlers to find through links alone.
  • Pages are poorly linked — new or orphaned pages with few internal links may never be crawled.
  • Your site is new — with few external links pointing in, a sitemap jump-starts discovery.
  • Content changes often — a fresh lastmod hint nudges crawlers to recheck updated pages.

Small, well-linked sites still benefit from the clarity a sitemap provides, and submitting one in Google Search Console gives you indexing diagnostics you wouldn't otherwise see.

Anatomy of a Valid sitemap.xml

A minimal, valid sitemap needs only the declaration, the namespaced urlset, and one or more url/loc pairs. Here is the shape every entry follows:

TagRequired?What it does
<loc>YesThe full, absolute URL of the page, including the scheme (https://).
<lastmod>NoThe date the page last changed, in W3C format (YYYY-MM-DD).
<changefreq>NoA hint about update cadence: always, hourly, daily, weekly, monthly, yearly, or never.
<priority>NoRelative importance from 0.0 to 1.0 (default 0.5). Only meaningful within your own site.

URLs must be properly escaped — ampersands become &amp;, and other reserved characters are encoded — so a stray query string never breaks the file. A good generator handles this for you.

How to Build Your Sitemap in Seconds

1. Collect your URLs

Gather the canonical URLs you want indexed — one per line. Skip duplicates, redirected pages, and anything blocked by robots.txt or a noindex tag. Only include the version you actually want to rank.

2. Paste them into the generator

Drop your list into the tool above. It validates each line, upgrades bare domains to https://, removes duplicates, and warns you about anything that isn't a usable URL.

3. Set optional hints

Add a priority and changefreq if you want them, and toggle lastmod to stamp today's date. These are hints, not commands — treat them as guidance for crawlers, not guarantees.

4. Copy or download sitemap.xml

Copy the output or download the sitemap.xml file, then upload it to your site's root (for example, https://example.com/sitemap.xml).

How to Submit and Maintain Your Sitemap

  • Reference it in robots.txt — add a line like Sitemap: https://example.com/sitemap.xml so every crawler can find it.
  • Submit it in Google Search Console — use the Sitemaps report to submit the URL and monitor how many pages get indexed.
  • Keep it fresh — regenerate when you add, remove, or substantially update pages so crawlers always see the current list.
  • Only list indexable URLs — never include noindexed, redirected, or canonicalized-away pages; mixed signals waste crawl budget.

Expert Tips

List only indexable URLs

Include the canonical version of each page you want ranked. Drop redirects, duplicates, and noindexed pages so you never send crawlers mixed signals or waste crawl budget.

Submit it in Search Console

Add the sitemap URL to robots.txt and submit it in Google Search Console. The Sitemaps report shows how many pages were discovered and indexed, turning your sitemap into a diagnostic tool.

Frequently Asked Questions

What is an XML sitemap?

An XML sitemap is a file that lists the URLs on your site in the sitemaps.org format so search engines can discover and crawl them. Each URL can include optional hints like lastmod, changefreq, and priority.

Do I really need a sitemap for SEO?

A sitemap won't directly boost rankings, but it helps search engines find every page you want indexed — which matters most for large sites, new sites, or pages with few internal links. It also unlocks indexing diagnostics in Search Console, so it's worth having.

How many URLs can one sitemap contain?

A single sitemap file can hold up to 50,000 URLs and must stay under 50 MB uncompressed. If you exceed either limit, split your URLs across multiple sitemaps and list them in a sitemap index file.

Where do I put the sitemap file?

Upload sitemap.xml to your site's root so it's reachable at a URL like https://example.com/sitemap.xml, reference it in robots.txt, and submit that URL in Google Search Console.

Related guides

Related tools