HTML Encoder & Decoder

Encode special characters to HTML entities or decode entities back to plain text. Prevents XSS attacks and ensures safe display of content in HTML pages.

Mode:
Examples:
Plain text / HTML
Encoded output7 entities
<script>alert("XSS")</script>

Common HTML entities

What are HTML Entities?

HTML entities are special sequences that represent characters which have meaning in HTML syntax. For example, the < character starts an HTML tag, so to display it as text you must encode it as &lt;. Similarly, & must be encoded as&amp; because it starts entity references.

There are three formats: named entities (&amp;),decimal entities (&#38;), and hex entities (&#x26;). All produce the same output character.

Common HTML Entities Reference

CharacterNamedDecimalHexDescription
&&amp;amp;&amp;#38;&amp;#x26;Ampersand
<&amp;lt;&amp;#60;&amp;#x3C;Less-than
>&amp;gt;&amp;#62;&amp;#x3E;Greater-than
"&amp;quot;&amp;#34;&amp;#x22;Double quote
'&amp;apos;&amp;#39;&amp;#x27;Single quote / apostrophe
©&amp;copy;&amp;#169;&amp;#xA9;Copyright
&amp;mdash;&amp;#8212;&amp;#x2014;Em dash
&amp;euro;&amp;#8364;&amp;#x20AC;Euro sign

When to Encode vs Decode

Encode when inserting user-supplied text into HTML — form inputs, comments, database content displayed on pages. This prevents Cross-Site Scripting (XSS) attacks.

Decode when you receive HTML-encoded text and need the original characters — for example, parsing RSS feeds, processing API responses, or extracting text from HTML documents.