Staaarter

XML Sitemap Generator

Generates valid sitemap.xml text from a list of URLs pasted one per line, with optional shared defaults for lastmod (a date you type in, never a live timestamp), changefreq, and priority applied to every entry. Escapes XML special characters and skips lines that aren't valid absolute URLs. A free online tool from Staaarter, right in your browser.

Runs locallyUpdated 2026-08-04
By Staaarter Team
generatorstaticcrawling

Overview

Introduction

Writing sitemap XML by hand is mostly boilerplate: the same <urlset> wrapper, the same <url><loc>...</loc></url> structure repeated for every page, and easy-to-miss details like escaping an ampersand in a URL's query string.

This tool takes a plain list of URLs, one per line, the same way you might already have them in a spreadsheet or from a crawl export, and produces correctly formatted, properly escaped sitemap XML ready to upload.

What Is XML Sitemap Generator?

A sitemap.xml generator that turns a newline-separated list of URLs into a valid <urlset> document, with optional shared <lastmod>, <changefreq>, and <priority> values applied to every entry.

It's deliberately simple and deterministic: there's no automatic "today's date" stamping, no crawling, and no per-URL customization beyond the list itself, keeping the output predictable and easy to review before you upload it.

How XML Sitemap Generator Works

Each non-empty line in the URL list becomes a <url><loc>...</loc></url> block; lines that aren't valid absolute http:// or https:// URLs are skipped and counted rather than silently included as broken entries.

If you fill in a lastmod date, changefreq, or priority, that exact value is applied identically to every URL in the output; leaving a field blank omits that element entirely for every entry, matching the protocol's rule that all three are optional.

When To Use XML Sitemap Generator

Building a sitemap for a small to mid-sized site from a manually maintained list of URLs, without needing a CMS plugin or build-time generator.

Quickly producing a sitemap from a list of URLs exported from a crawler, spreadsheet, or site audit tool.

Features

Advantages

  • Escapes XML special characters (&, <, >, quotes) in every URL automatically, avoiding a common cause of malformed sitemap XML from URLs with query parameters.
  • Never fabricates a lastmod timestamp; the field is blank by default and only appears in the output if you explicitly set one, keeping the freshness signal honest.
  • Reports how many input lines were skipped as invalid, so you know if you need to go back and fix a typo rather than silently losing URLs.

Limitations

  • This applies one shared lastmod/changefreq/priority value to every URL in the list; it doesn't support setting different values per individual URL in one pass.
  • It doesn't crawl your site or verify the URLs you list actually exist; it only validates that each line is a well-formed absolute URL. Pair it with the xml-sitemap-validator or broken-link-checker tools to catch dead links.

Examples

A basic three-URL sitemap with no extras

Input

https://example.com/
https://example.com/about
https://example.com/contact

Output

<?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/contact</loc>
  </url>
</urlset>

With lastmod, changefreq, and priority all left blank, only <loc> is emitted for each URL, which is fully valid per the protocol since all three are optional.

A URL with a query string and a shared lastmod

Input

https://example.com/search?q=shoes&size=10
Lastmod: 2026-02-01

Output

<url>
  <loc>https://example.com/search?q=shoes&amp;size=10</loc>
  <lastmod>2026-02-01</lastmod>
</url>

The & in the query string is escaped to &amp;, which is required for the sitemap to be valid XML; an unescaped & is one of the most common causes of a rejected sitemap.

Best Practices & Notes

Best Practices

  • Only set lastmod when you actually know the date content changed; an inaccurate or blanket lastmod value can make search engines trust the field less over time.
  • Keep each generated sitemap under 50,000 URLs and about 50MB uncompressed, the sitemaps.org protocol's hard limits; split a larger URL list across multiple generated sitemaps and a sitemap index.
  • Only include canonical, indexable URLs in a sitemap; listing redirected, noindexed, or duplicate URLs sends search engines mixed signals about what's canonical.

Developer Notes

Output is fully deterministic: the same URL list and options always produce byte-identical XML, since no timestamp or random value is ever generated internally; this makes the tool safe to use in a repeatable workflow.

XML Sitemap Generator Use Cases

  • Generating a sitemap for a small static site or landing page set without a CMS or build pipeline
  • Producing a sitemap from a URL list exported from a site crawl or spreadsheet audit
  • Quickly rebuilding a sitemap after a batch of pages were added, using the same shared changefreq/priority as before

Common Mistakes

  • Pasting URLs with unescaped ampersands directly into hand-written XML instead of using a generator, producing a file that fails XML parsing entirely.
  • Setting priority to 1.0 on every single URL, which defeats its purpose as a relative signal between pages on the same site and is commonly flagged as a low-value SEO practice.

Tips

  • After generating, run the output through the xml-sitemap-validator tool to double check it against the full protocol before uploading.
  • If a URL count looks unexpectedly low, check the skipped-lines note above the output; a stray blank line or a URL missing its https:// scheme is the usual cause.

References

Frequently Asked Questions