HTML Entity Encoder & Decoder

Encode and decode HTML entities. Convert special characters to &, <, > and decode them back.

Free Always No Account Needed 100% Client-Side
Common entities: &lt; (<) · &gt; (>) · &amp; (&) · &quot; (") · &apos;(')

About this tool

HTML entities are special codes used to display reserved characters and symbols in HTML. For example, the less-than sign < must be written as < in HTML to avoid being interpreted as a tag.

This tool encodes/decodes: - Reserved characters: < > & " ' - Extended ASCII and Unicode characters: © ® ™ € - Numeric character references: < (decimal) and < (hex) - All named HTML5 entities (over 2,000 named entities)

Use cases: Escaping user-generated content before inserting into HTML (XSS prevention), debugging HTML source, converting characters for safe inclusion in XML/RSS feeds, and displaying code examples in HTML.

Frequently Asked Questions

Why do I need HTML entities?
HTML reserves certain characters (<, >, &, ") for markup. To display them as literal characters, you must use their entity equivalents.
What is XSS and how do entities help?
XSS (Cross-Site Scripting) is an attack where malicious scripts are injected via user input. HTML-encoding user input before displaying it prevents script injection.
What's the difference between &amp; and &#38;?
Both represent the & character. Named entities (&amp;) are readable; numeric entities (&#38; decimal, &#x26; hex) work for any Unicode character.
Should I use entities or CSS escape for non-breaking space?
Use &nbsp; in HTML content. In CSS content property, use \00a0. In JavaScript, use \u00A0.

Related Tools