Skip to content
Encode & Decode

HTML Entity Encoder & Decoder

HTML entities let you display characters that would otherwise be interpreted as markup. Writing a literal < in HTML starts a tag; writing &lt; displays the character instead. This tool converts in both directions.

Free, no signupRuns entirely in your browser
Input
Result
&#60;div&#62;Hello &#38; Welcome&#60;/div&#62;
About

What the HTML Entity Encoder & Decoder does

The four that always need escaping are < and > because they delimit tags, & because it starts an entity, and quotes when inside an attribute value. Escaping user-supplied content before rendering it is also the primary defence against cross-site scripting — if a submitted <script> tag is escaped, it displays as text instead of executing.

How it works

Using the HTML Entity Encoder & Decoder

  1. 1Paste your text or HTML.
  2. 2Choose encode or decode.
  3. 3Encoding replaces reserved and non-ASCII characters with numeric entity references.
  4. 4Decoding converts entity references back into the characters they represent.
  5. 5Copy the result into your page or editor.
Use cases

What people use it for

  • Displaying a code sample on a web page without it rendering
  • Escaping user input before inserting it into a template
  • Decoding entity-heavy text from a CMS export or RSS feed
  • Fixing text that shows &amp;amp; instead of &
FAQ

Frequently asked questions

6 related

Related tools

All tools →