Sitemap URL XML Escaper

Escapes URLs so they are valid inside sitemap XML.

Use the tool

Why this tool exists

A raw ampersand in a sitemap makes the XML invalid. So do spaces and some characters in URLs.

This tool percent-encodes unsafe characters and then applies the XML entity escapes from sitemaps.org (& ' " > <). By default it leaves existing entities alone so you do not get &.

How to use it

  1. Paste raw URLs, one per line.
  2. Choose whether to wrap them in loc tags.
  3. Leave the other options as they are for most cases.
  4. Copy the result.

Frequently asked questions

Why does & become &?

XML needs it. The crawler reads it back as &.

What about double escaping?

Keep the entity option on to avoid it.

Does it change %20?

No, existing percent-escapes are kept.

Do I need this if I use a generator?

Good generators do it already. This is for hand-made lists.