sitekits.dev
press ⌘K to switch tools
ENCODE & DECODE

XML String Escaper

Escape and unescape XML special characters.

local
xml-escape
§01 ABOUT THIS TOOL

Overview

XML reserves five characters — &, <, >, ", ' — that must be written as entities inside element content and attribute values, or the document fails to parse. This tool escapes text for safe embedding in XML (config files, SVG, RSS, SOAP payloads) and unescapes entity-laden XML back to readable text.

How to use

  1. Choose Escape to convert plain text into entities, or Unescape to reverse it.
  2. Paste your input into the XML text (or Escaped XML) field.
  3. Read or copy the converted output from the Result field — it updates as you type.

Examples

  • <node attr="v">A & B</node>&lt;node attr=&quot;v&quot;&gt;A &amp; B&lt;/node&gt;
  • Tom &amp; JerryTom & Jerry

Notes

Escaping order matters when done by hand — & must be escaped first or you double-escape existing entities; the tool handles this in a single pass. These entities also work in HTML, but HTML defines many more named entities (&nbsp;, &copy;, …) that this XML-focused tool intentionally does not decode.

FAQ
Is my input sent to a server?
No. The five-character replacement runs entirely in your browser as a simple string operation. Nothing leaves your machine.
Which characters are escaped?
The five XML special characters: & becomes &amp;, < becomes &lt;, > becomes &gt;, double quote becomes &quot;, and apostrophe becomes &apos;.
Does Unescape handle numeric entities?
It decodes the five named entities plus &#39; (the numeric apostrophe). Other numeric character references such as &#x3042; are left unchanged.