How to Extract All URLs from a Sitemap

How to Extract All URLs from a Sitemap

To extract URLs from a sitemap, paste the XML and pull out every <loc> value into a plain list. That gives you sitemap URLs you can sort, deduplicate, audit, or feed into another crawler. Here is how sitemaps are structured and how to get a clean list in seconds.

How a sitemap is structured

An XML sitemap is a simple file that lists the pages you want search engines to know about. The format is fixed:

  • The root element is <urlset>.
  • Each page sits inside a <url> element.
  • The actual address lives in a <loc> tag, with optional <lastmod>, <changefreq>, and <priority> siblings.

So pulling the URLs really means reading every <loc> value. A single sitemap is capped at 50,000 URLs and 50MB uncompressed. Large sites split content across several sitemaps to stay under that limit.

Sitemap index files

When a site has more URLs than one file can hold, it uses a sitemap index. The root element changes to <sitemapindex>, and instead of <url> entries it contains <sitemap> entries, each with a <loc> pointing to a child sitemap rather than a page.

If you paste an index file, you will get the URLs of the child sitemaps, not the pages themselves. To build a full URL list you expand each child sitemap and extract the <loc> values from those. It is a two-step pass: index first, then each sitemap it references.

How to extract sitemap URLs

The Sitemap URL Extractor parses the XML you paste, so grab the sitemap source first. Open the sitemap URL in your browser (commonly /sitemap.xml or /sitemap_index.xml), then view source or use Ctrl+A to select everything.

  1. Open the Sitemap URL Extractor.
  2. Paste the full XML from your sitemap or sitemap index.
  3. Let it pull every <loc> value into a plain list.
  4. Copy the result, or sort and deduplicate before exporting.
  5. If you pasted an index, repeat the steps for each child sitemap it lists.

Everything runs in your browser. The XML you paste never leaves your device, which matters when you are auditing staging or client sites that are not public yet.

Why a clean URL list helps

A flat list of sitemap URLs is the starting point for most technical SEO work:

  • Audits: feed the list into a crawler or check tool to find broken pages, missing titles, or noindex slips.
  • Migrations: map old URLs to new ones for redirect planning, so nothing drops out of the index during a replatform.
  • Bulk checks: run status codes, canonicals, or response times across the full set instead of clicking through pages one at a time.
  • Coverage: compare what is in the sitemap against what is actually getting crawled and indexed.

Because the sitemap is the site’s own declaration of what should exist, it is the cleanest inventory you can start an audit from.

Paste your sitemap, pull the <loc> values, and you have your whole site in one list.

← All posts