Skip to content
Home / HTML Entity Codec

HTML Entity Encoder/Decoder

What are HTML entities?

HTML entities are text representations of characters that would otherwise have special meaning in HTML markup, like < and &, or characters that are hard to type directly. Encoding converts these characters into a safe, literal form like &lt; so they display correctly instead of being interpreted as HTML.

When would I use this?

  • Safely displaying a code snippet containing angle brackets inside an HTML page.
  • Encoding user-submitted text before inserting it into HTML, to prevent it from breaking the page structure.
  • Decoding entities you see in HTML source, like &amp;, back into readable text.

How it works

Encoding replaces reserved characters with their entity equivalents using JavaScript. Decoding uses the browser's own HTML parser to safely convert entities back to text, without executing any markup.

Frequently asked questions

Characters with special meaning in HTML — such as <, >, &, ", and ' — are converted to their named or numeric HTML entity equivalents (like &lt; and &amp;), so they display literally instead of being interpreted as markup.
When embedding user-generated or arbitrary text inside HTML markup, to prevent it from being misinterpreted as tags or breaking the page layout, or to safely display code snippets containing angle brackets.
Yes, switch to "Decode" to convert HTML entities like &amp;amp; or &amp;#39; back into their literal characters.
No, encoding and decoding happen entirely in your browser using JavaScript.