SnappTools logoSnappTools

HTML Entity Encoder/Decoder

Encode special characters to HTML entities or decode them back.

Entity Format (for encoding)

Uses named entities like & < > " where available

Result will appear here...

Common HTML Entities

CharacterNamedNumeric
&&&
<&lt;&#60;
>&gt;&#62;
"&quot;&#34;
'&#39;&#39;
  (nbsp)&nbsp;&#160;
©&copy;&#169;
®&reg;&#174;
&trade;&#8482;
&euro;&#8364;

About HTML Entity Encoder/Decoder

HTML Entity Encoder/Decoder converts special characters to their HTML entity equivalents and decodes entities back to the original characters. Encodes characters like < > & " ' to &lt; &gt; &amp; &quot; &#39; and vice versa.

Encoding user-supplied content before rendering it in HTML is a critical security practice — it prevents cross-site scripting (XSS) attacks where malicious HTML or JavaScript is injected into your pages. This tool helps you understand and apply correct encoding.

Also handles numeric entities (&#60;) and named entities (&lt;) in both directions.

Features

  • Encode HTML special characters to entities
  • Decode HTML entities back to characters
  • Handles named and numeric entities
  • Prevents XSS by showing safe encoded output
  • Real-time encoding/decoding

Common Use Cases

  • Encoding user input before rendering in HTML
  • Decoding HTML entities in content for editing
  • Understanding XSS prevention techniques
  • Encoding email addresses against scrapers