{}DevStringToolsAll tools
Blog/

Sitemap URL Extractor: Pull Every URL Out of a sitemap.xml

Extract every <loc> from a sitemap.xml file by URL or pasted XML. Sitemap URL Extractor handles both urlset and sitemapindex formats, deduplicates, and outputs a clean list — all in your browser.

seositemapxml parserdeveloper tools

Sitemap URL Extractor: Pull Every URL Out of a sitemap.xml

Your sitemap.xml is the canonical inventory of every page Google should know about — but reading a raw XML file doesn't help when you need a flat list of URLs to feed a crawler, a redirect mapping, or an analytics dashboard.

You need to extract sitemap URLs quickly, cleanly, and without uploading your sitemap to a third-party service.

The Sitemap URL Extractor on DevStringTools does exactly that: parses any sitemap.xml, walks every <loc> element, deduplicates, and outputs one URL per line — entirely in your browser.

Why Extract URLs from a Sitemap?

Sitemaps are the source of truth for which URLs a site wants indexed. The moment you need the URL list outside of Google Search Console, you hit friction:

  • Crawl audits — Compare what Google sees against your actual site structure
  • Redirect mapping — Move a site to a new domain and map every old URL to a new one
  • Internal linking reports — Build a backlink matrix across your entire site
  • Content audits — Find URLs missing metadata, redirects, or canonical tags
  • Bulk submissions — Submit URLs to Bing, Yandex, or third-party indexers

A sitemap parser turns a 5 MB XML file into a clean copy-pasteable list in seconds.

What the Sitemap URL Extractor Handles

The tool supports both standard sitemap formats:

<urlset> — The Regular Sitemap

This is what 99% of sites have. A flat list of <url><loc>...</loc></url> entries.

<?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>
</urlset>

Every <loc> becomes one line of output.

<sitemapindex> — The Sitemap of Sitemaps

Large sites split their sitemap across multiple files for performance. A sitemap index points to each child sitemap.

<?xml version="1.0" encoding="UTF-8"?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
  <sitemap><loc>https://example.com/sitemap-posts.xml</loc></sitemap>
  <sitemap><loc>https://example.com/sitemap-pages.xml</loc></sitemap>
</sitemapindex>

The extractor surfaces every child sitemap URL so you know which files to fetch next. It does not auto-follow them — that keeps the parse fast and predictable.

How to Use It

Option 1: Paste the Sitemap URL

If your sitemap is publicly accessible, paste the URL into the input and click Fetch sitemap.

https://example.com/sitemap.xml

The tool routes the request through a public CORS proxy (api.allorigins.win), which means:

  • ✅ Works for most public sitemaps without auth
  • ⚠️ Some sites block proxies, return 403 to non-browser user agents, or rate-limit unknown clients
  • ⚠️ Sensitive sitemaps (with internal URLs) should not be fetched — the proxy operator can technically see the request

When the fetch fails, the fallback is simple: open the sitemap in your browser, view source, copy everything, paste into the input box. Parsing then runs 100% locally.

Option 2: Paste the Raw XML

If the URL fetch is blocked, or you have a sitemap on your local machine, paste the raw XML directly:

<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
  <url><loc>https://example.com/</loc><lastmod>2026-07-01</lastmod></url>
  <url><loc>https://example.com/about/</loc><lastmod>2026-06-15</lastmod></url>
</urlset>

The parser walks the XML using the browser's native DOMParser, so no network round-trip is involved.

Toggle Options

  • Sort alphabetically — Reorder the output for diff-friendly comparison
  • Remove duplicates — Collapse repeated <loc> entries (sitemaps sometimes list the same URL twice due to canonical or trailing-slash mistakes)

The output updates live as you edit the input.

Sample Output

After parsing a typical 200-URL sitemap, the output looks like:

https://example.com/
https://example.com/about/
https://example.com/blog/
https://example.com/blog/first-post/
https://example.com/blog/second-post/
https://example.com/contact/
https://example.com/pricing/
...

One URL per line, ready to drop into a spreadsheet, a crawler config, or a curl loop.

Common Use Cases

Bulk URL Submission to a Crawler

You want Screaming Frog, Sitebulb, or your own crawler to fetch every page. Copy the sitemap URLs and paste into the crawler's "Start URL" list — saves you from configuring site discovery.

Redirect Mapping for a Site Migration

Migrating from oldsite.com to newsite.com? Extract every URL from the old sitemap, write a mapping (oldsite.com/foo/newsite.com/foo/), then feed that map into your redirect generator.

Compare Sitemaps Across Time

Pull this month's sitemap and last month's, sort both alphabetically, diff the result. New pages appear as additions, removed pages as deletions — no log diving required.

Find URLs Missing from Your Sitemap

Crawl your site with your usual crawler, then compare the crawled list against the sitemap output. Any URL that appears in the crawl but not in the sitemap is an indexing gap.

What About <lastmod>, <priority>, and <changefreq>?

The extractor reads them but does not include them in the default output. The output is intentionally minimal — one URL per line — because most downstream tools expect that shape.

If you need richer data, the underlying parseSitemap function returns lastmod, changefreq, and priority per entry, so a custom integration is straightforward.

Limits and Edge Cases

Scenario Behavior
Sitemap with tens of thousands of <loc> entries Parses fine — limited only by browser memory
Sitemap behind auth or session cookies Fetch will fail; paste XML manually
Sitemap with malformed XML Parser surfaces the syntax error position
sitemapindex pointing at compressed child sitemaps Lists the child URLs but does not decompress them — fetch each one separately
Mixed <urlset> and <sitemap> in the same file Both are parsed; <loc> entries from both are returned

Privacy

The pasted XML is parsed entirely in your browser. No bytes leave your machine.

The "Fetch sitemap" feature is the only path that touches the network — and even then, the request goes through a public CORS proxy (api.allorigins.win). For sensitive sitemaps, paste the XML directly to keep everything local.

Try It Now

Open the Sitemap URL Extractor tool and paste your sitemap. If you have a large site, start with one of your smaller sub-sitemaps to get the feel of the output format.


Related Tools

  • Sort Lines — Reorder the extracted URL list for diff comparison
  • Remove Duplicates — Strip repeated entries after a cross-sitemap merge
  • Find and Replace — Bulk-rewrite URLs after a migration (http → https, add trailing slashes, etc.)

FAQ

Does the tool support gzip-compressed sitemaps? The XML parser handles uncompressed XML only. If your server returns Content-Encoding: gzip, decompress locally with curl --compressed or your browser's dev tools, then paste the decompressed XML.

Can it follow a <sitemapindex> and extract every child URL? No — by design. The extractor surfaces every child sitemap URL but does not fetch them. Auto-following chained indexes slows the tool and hides which files exist. Fetch each child sitemap manually if you need a flat URL list.

Are <lastmod> and <priority> preserved? They are read but not included in the default output, which is just one URL per line. The underlying parse function returns these fields if you want richer data.

Why are duplicates removed by default? Sitemaps sometimes list the same <loc> twice (canonical variants, trailing-slash mistakes). Deduplication gives a clean list without manual filtering. Disable it from the toggle if you want every occurrence.

Is my XML sent to a server? Pasted XML never leaves your browser — parsing is 100% local. Fetched URLs are relayed through a public CORS proxy, so the proxy operator can technically see them. For sensitive sitemaps, paste the XML directly.

How many URLs can it handle? On a modern browser, the parser comfortably handles tens of thousands of <loc> entries. The limit is browser memory, not the parser; outputs of a few megabytes render without issue.