>_devtools

HTML Entity Encoder / Decoder

Encode special characters as named or numeric HTML entities, or decode entities back to text.

What this does

Converts characters to HTML entities and back. Encoding makes text safe to place inside HTML or XML: <, >, & and quotes become&lt;, &gt;, &amp;, &quot;. Decoding turns entities such as &eacute;, &#233; and&#xE9; back into the characters they stand for.

Encoding modes

  • Only special characters escapes & < > " '. This is what you want for safely embedding text in HTML; apostrophes use &#39;because &apos; is not valid in HTML 4.
  • Special and non-ASCII also converts every character above U+007F, using a named entity when one exists (&copy;, &euro;) and a numeric one otherwise. The result is pure ASCII.
  • Every character turns all characters except line breaks into numeric references, which is useful for obfuscation tests and for checking how a parser treats entities.

Decoding behavior

Decimal (&#169;) and hexadecimal (&#xA9;) references are decoded for any code point, including emoji. Named references are resolved with the browser's own HTML parser, so the full HTML5 set (about 2,200 names such as&check;) works. Named references need the trailing semicolon. Numbers 128-159 are mapped the way browsers do (Windows-1252), and impossible code points become U+FFFD. Unknown names are left untouched rather than guessed at. Decoding runs once, so&amp;lt; becomes &lt;.

Example

<a href="/?q=café"> encodes to&lt;a href=&quot;/?q=café&quot;&gt;, or with non-ASCII encoding on,&lt;a href=&quot;/?q=caf&eacute;&quot;&gt;.

Privacy

Everything runs in your browser. Nothing you paste is uploaded or stored.