HTML Entity Encoder / Decoder

Encode special characters to HTML entities or decode them back to text. Live preview as you type. No data leaves your browser.

Essential HTML Entities

EntityCharacterDescription
&&Ampersand
&lt;<Less than
&gt;>Greater than
&quot;"Double quote
&apos;'Apostrophe

How It Works

  • Encode: Converts special characters to their HTML entity equivalents (&, <, >, etc.)
  • Decode: Converts HTML entities back to their original characters
  • Live Preview: Output updates instantly as you type
  • 100% Safe: All processing happens in your browser — nothing is sent to any server

Frequently Asked Questions

What are HTML entities?

HTML entities are special character codes that represent reserved characters or symbols in HTML. For example, &amp; represents &, &lt; represents <, and &gt; represents >. They prevent browsers from interpreting characters as HTML markup.

When should I encode text to HTML entities?

You should encode user-supplied text before displaying it in HTML to prevent XSS (cross-site scripting) attacks and to display special characters correctly. You also need to encode the 5 essential characters: &amp;, &lt;, &gt;, &quot;, and &apos; in HTML attributes.

Can I decode HTML entities back to text?

Yes, absolutely. This tool can decode named entities (&amp;), decimal entities (&#38;), and hexadecimal entities (&#x26;) back to their original characters. Just switch to Decode mode and paste the encoded text.

Is my data safe?

Yes, absolutely. All encoding and decoding happens entirely in your browser using JavaScript. No data is sent to any server or stored anywhere.