DevBolt

HTML Entity Encoder Online

Encode special characters into HTML entities instantly in your browser. This free tool converts characters like <, >, and & into their safe HTML equivalents client-side.

← Back to tools

HTML Entity Encoder & Decoder

Encode special characters as HTML entities or decode entities back to text. Fast, private, and free.

Encode mode:
Only encodes & < > " ' (safe for HTML content)

Common HTML Entities

CharacterNamedNumericDescription
&&amp;&#38;Ampersand
<&lt;&#60;Less than
>&gt;&#62;Greater than
"&quot;&#34;Double quote
'&apos;&#39;Single quote
&nbsp;&#160;Non-breaking space
©&copy;&#169;Copyright
®&reg;&#174;Registered trademark
&trade;&#8482;Trademark
&euro;&#8364;Euro sign
£&pound;&#163;Pound sign
&mdash;&#8212;Em dash
&ndash;&#8211;En dash
&hellip;&#8230;Ellipsis
°&deg;&#176;Degree
×&times;&#215;Multiply
÷&divide;&#247;Divide
&rarr;&#8594;Right arrow

Quick Reference

Minimal mode encodes only the 5 characters that are special in HTML/XML: & < > " '. Use this when your text contains HTML tags or attributes.

All Characters mode also encodes every non-ASCII character (accented letters, symbols, emoji) using named entities where available, or numeric codes. Use this when you need pure ASCII output.

Decoding recognizes named entities (&amp;), decimal codes (&#169;), and hex codes (&#xA9;).

What are HTML entities?

HTML entities are special codes used to represent characters that have reserved meaning in HTML or that cannot be easily typed on a keyboard. For example, the less-than sign (<) is written as &lt; and the ampersand (&) is written as &amp;. Entities can use named references (like &copy; for ©) or numeric references (like &#169;).

Why encode HTML entities?

Encoding HTML entities is essential for preventing XSS (cross-site scripting) vulnerabilities in web applications, displaying code snippets on web pages without the browser interpreting them as markup, correctly rendering special characters and symbols in HTML documents, and ensuring that user-generated content is safe to display.

Frequently Asked Questions

Which characters need to be HTML-encoded?

At minimum, you should encode the five characters with special meaning in HTML: < (&lt;), > (&gt;), & (&amp;), " (&quot;), and ' (&#39;). Additionally, non-ASCII characters like © and é can be encoded for maximum compatibility.

Does HTML entity encoding prevent XSS attacks?

Encoding the key characters (<, >, &, ", ') is a critical part of XSS prevention. It stops browsers from interpreting user input as executable HTML or JavaScript. However, complete XSS protection requires encoding in the right context and using a Content Security Policy.