Skip to main content

HTML Entity Encoder & Decoder

Escape special characters as HTML entities, or turn entities back into text. Everything runs in your browser, so your input isn’t uploaded.

Loading tool…

How to use the HTML Entity Encoder & Decoder

  1. Choose Encode or Decode.
  2. Paste your text. The result updates as you type.
  3. When encoding, optionally convert every non-ASCII character to a numeric entity.

Example

Encoding makes markup safe to show as text: the angle brackets, ampersand and quotes are replaced by entities.

Input
<a href="x">Tom & Jerry</a>
Encoded
&lt;a href=&quot;x&quot;&gt;Tom &amp; Jerry&lt;/a&gt;

About this tool

Characters like < and & have special meaning in HTML, so to show them as text they are written as entities such as &lt; and &amp;. This tool escapes text for use in a page and decodes entities back to normal characters.

Good to know

  • Pasted HTML is handled purely as text. Nothing you paste is ever added to the page, so it can’t run.
  • Decoding understands numeric entities and a common set of named ones. Unknown names are left exactly as typed.
  • Escaping the characters &, <, >, double quotes and single quotes helps when placing text inside HTML, but it is not a substitute for a full security review of your site.

Related tools

Browse all tools