codeHTML Entity Encoder / Decoder

Encode special characters to HTML entities or decode them back

HTML / Text Input

0 chars

Encoded Output

Output will appear here

Common HTML Entities

&&Ampersand
<&lt;Less than
>&gt;Greater than
"&quot;Double quote
'&#39;Single quote
©&copy;Copyright
®&reg;Registered
&trade;Trademark
 &nbsp;Non-breaking space
&ndash;En dash
-&mdash;Em dash
&lsquo;Left single quote
&rsquo;Right single quote
&ldquo;Left double quote
&rdquo;Right double quote
°&deg;Degree
±&plusmn;Plus-minus
×&times;Multiply
÷&divide;Divide
&ne;Not equal

HTML encoding converts special characters (like <, >, &, and quotes) into their safe HTML entity equivalents (like &lt;, &gt;, &amp;) so they display correctly as literal text instead of being interpreted as HTML markup. This tool encodes text for safe embedding in HTML, and decodes HTML entities back into normal readable text.

Frequently asked questions

In HTML, < and > are used to define tags - if you want to display them as literal text (like showing example code on a webpage), they need to be encoded as entities so the browser doesn't try to interpret them as markup.

Proper HTML encoding of user-generated content is one part of preventing XSS, since it stops malicious markup from being interpreted as active HTML - but full XSS prevention in an application involves broader security practices beyond just this encoding step.

Encoding takes normal text and converts special characters into safe HTML entities. Decoding does the reverse - taking HTML entities and converting them back into their normal readable characters.