Skip to content
Popular tools

HTML Entity Encoder

Encode and decode HTML entities.

LocalYour data is processed locally in your browser and is not uploaded to Alphzen.

Paste text to encode or decode.

How to use

  1. Paste text or markup.
  2. Minimal encoding escapes &, <, >, quotes. Numeric encoding also turns non-ASCII into &#…; entities.
  3. Encode or Decode.
  4. Copy the result. Decoding does not run HTML or scripts.

Features

  • Escapes the characters that break HTML text nodes and attributes.
  • Optional numeric encoding for non-ASCII.
  • Decodes named, decimal, and hexadecimal entities.
  • Does not use innerHTML, so untrusted input is not executed.
  • Local processing only.

Examples

Escape markup
<a href="/x">Ada & Co</a>
&lt;a href=&quot;/x&quot;&gt;Ada &amp; Co&lt;/a&gt;

FAQ

Will this sanitize HTML?

No. Encoding text for safe insertion into HTML is not the same as sanitizing a document. Do not treat the output as a security boundary for rich HTML.

Why not decode with a hidden DOM node?

Assigning user text to innerHTML can run markup. Alphzen decodes entities with a parser that only understands &…; sequences.

Which named entities are supported?

Decode understands the XML five, Latin-1 names, and common punctuation names such as ndash, copy, and euro. Unknown names are left unchanged.

Related tools

About this tool

HTML entities let you write characters that would otherwise be parsed as markup. The minimum useful set is ampersand, angle brackets, and quotes.

Decoding is for data you already have as entities — RSS snippets, copied source, or escaped CMS fields. It is not an HTML browser.

For URLs, use the URL Encoder. For binary-safe ASCII transport, use Base64.