Text

HTML Entity Encode / Decode

Input

Enter raw HTML or entity-encoded text.

Convert in both directions without sending data to a server.

Output

Output appears here after encoding or decoding.

Frequently Asked Questions

What is an HTML entity?
An HTML entity is a text string starting with & and ending with ; that represents a special character. For example, &lt; renders as <, &amp; renders as &, and &copy; renders as ©. Entities prevent special characters from being interpreted as HTML markup.
When should I encode HTML entities?
Always encode < > & " when inserting user-provided content into HTML to prevent Cross-Site Scripting (XSS) attacks. Entities are also needed for characters not available on standard keyboards and for characters with special HTML meaning.
What is the difference between named and numeric entities?
Named entities (&copy;) are human-readable aliases. Numeric decimal entities (&#169;) and hexadecimal entities (&#xA9;) reference the Unicode code point directly. All three represent the same character. Named entities only exist for a subset of characters; numeric entities work for any Unicode character.