Skip to content
Developer

HTML Entity Encoder & Decoder

Last updated: July 11, 2026

Encode text to HTML entities or decode HTML entities back to text. Supports named entities (< > &) and numeric entities (< <). Essential for safely displaying user content in web pages.

How to Use This Tool

  1. Choose Encode mode to convert text into HTML entities, or Decode mode to convert entities back to text.
  2. Paste or type your text into the input field.
  3. Click "Encode" or "Decode" to process the text.
  4. Copy the output using the "Copy Output to Clipboard" button.

Common HTML Entities

Character Named Entity Decimal Entity Hex Entity Description
<&lt;&#60;&#x3C;Less-than sign
>&gt;&#62;&#x3E;Greater-than sign
&&amp;&#38;&#x26;Ampersand
"&quot;&#34;&#x22;Double quotation mark
'&apos;&#39;&#x27;Single quotation mark
 &nbsp;&#160;&#xA0;Non-breaking space
©&copy;&#169;&#xA9;Copyright symbol
&trade;&#8482;&#x2122;Trademark symbol
&euro;&#8364;&#x20AC;Euro symbol
&mdash;&#8212;&#x2014;Em dash

Frequently Asked Questions

What are HTML entities?

HTML entities are special codes used to display characters that have reserved meanings in HTML or cannot be easily typed. For example, &lt; displays the < character, and &amp; displays the & character. They start with & and end with ;.

When should I encode HTML entities?

You should encode HTML entities when displaying user-generated content to prevent XSS (Cross-Site Scripting) attacks. If a user types <script>alert(1)</script> and you render it without encoding, the browser will execute the script. Encoding converts < to &lt;, making it display as text instead of executing as code.

What are the most common HTML entities?

The five most commonly used entities are: &lt; (<), &gt; (>), &amp; (&), &quot; ("), and &apos; ('). These characters are reserved in HTML syntax and must be encoded when appearing in text content.

What is the difference between named and numeric entities?

Named entities use a human-readable name like &lt; for less-than. Numeric entities use decimal (&#60;) or hexadecimal (&#x3C;) code points. All named entities have numeric equivalents, but not all characters have named entities. Numeric entities can represent any Unicode character.

Disclaimer: This tool performs encoding and decoding locally in your browser. Always validate and sanitize user input on your server as well for complete security.

Rate this calculator