Skip to main content

HTML Entity Encoder & Decoder

Encode special characters to HTML entities or decode entities back to text.

How it works

  1. 1

    Choose Encode or Decode

    Select whether to encode text to HTML entities or decode entities back to text.

  2. 2

    Paste your text

    Type or paste your text. The conversion updates in real time.

  3. 3

    Copy the result

    Click Copy to copy the encoded or decoded output.

Common use cases

  • Encode HTML tags

    <div class="test">&copy;</div>

  • Decode entities

    &lt;p&gt;Hello &amp; welcome&lt;/p&gt;

About This Tool

Convert special characters like <, >, &, and quotes to their HTML entity equivalents (&lt;, &gt;, &amp;, &quot;) or decode HTML entities back to readable text. Two encoding modes: Smart mode encodes only characters that need escaping in HTML (angle brackets, ampersands, quotes, and non-ASCII characters), while Full mode converts every character to its numeric entity (&#NNN;).

Includes a quick reference table of common HTML entities for copyright symbols, dashes, currency signs, and math operators. Real-time conversion updates as you type.

All processing runs entirely in your browser -- nothing is sent to any server.

More examples

Examples

Encode HTML tags

Input

<div class="test">&copy;</div>

Output

&lt;div class=&quot;test&quot;&gt;&amp;copy;&lt;/div&gt;

Decode entities

Input

&lt;p&gt;Hello &amp; welcome&lt;/p&gt;

Output

<p>Hello & welcome</p>
Frequently Asked Questions
What are HTML entities?
HTML entities are special codes that represent characters which have meaning in HTML markup (like < and >) or characters not available on standard keyboards (like © and €). They start with & and end with ;.
When should I encode HTML entities?
Encode when displaying user input in HTML to prevent XSS attacks, when including special characters in HTML attributes, or when you need to show HTML tags as visible text rather than rendered markup.
What is the difference between Smart and Full encoding?
Smart mode only encodes characters that need escaping in HTML: <, >, &, quotes, and non-ASCII characters. Full mode converts every character to its numeric entity (&#NNN;), useful when you need maximum compatibility.
Is my data sent to a server?
No. All encoding and decoding happens entirely in your browser. Nothing is transmitted anywhere.

Discover More Tools

View all Developer Tools →