Free Online HTML Entity Encoder & Decoder

Encode and decode HTML entities. Convert special characters to HTML entities and back with named and numeric entity support.

html Input HTML
code Output Result
Characters: 0 | Bytes: 0
Characters: 0 | Bytes: 0

Common HTML Entities Reference

Character HTML Entity Description
&&Ampersand
<&lt;Less than
>&gt;Greater than
"&quot;Double quote
'&#39;Single quote
Space&nbsp;Non-breaking space
©&copy;Copyright
®&reg;Registered trademark
&trade;Trademark
&euro;Euro sign

Key Features

bolt

Fast Processing

All operations run locally in your browser for instant results with no server latency.

lock

Privacy Protected

Your data never leaves your browser. No server storage or tracking.

Frequently Asked Questions

Basics
What are HTML entities?expand_more
HTML entities are codes that start with an ampersand (&) and end with a semicolon (;), used to display reserved or hard-to-type characters in HTML documents. For example, the entity for < is &lt;, and the entity for > is &gt;.
Why encode HTML entities?expand_more
There are two main reasons: First, to prevent XSS (Cross-Site Scripting) attacks - if user input contains <script> tags, encoding converts them to plain text. Second, to ensure special characters display correctly across different encodings and browsers.
Which characters are encoded?expand_more
This tool encodes: & (&amp;), < (&lt;), > (&gt;), " (&quot;), ' (&#39;), © (&copy;), ® (&reg;), ™ (&trade;), € (&euro;), and all non-ASCII characters.
Technical Details
What is the difference between named entities and numeric entities?expand_more
Named entities (&amp;, &lt;, &copy;) use a mnemonic abbreviation that is easier to read. Numeric entities use the character's Unicode code point in either decimal (&#169;) or hexadecimal (&#xA9;) format. Browsers support both equally.
When is HTML entity encoding a sufficient XSS defense?expand_more
HTML entity encoding is sufficient when inserting untrusted data into the text content of an HTML element body. It is NOT sufficient for data placed inside HTML attribute values, JavaScript blocks, CSS, or URL parameters.