HTML Entity Encoder / Decoder

Encode text as HTML entities or decode entities back to plain text. 100% client-side.

Last reviewed: April 2026

New to this tool? Click here for instructions

Input
Output
Paste HTML or text above to encode or decode entities.

How to Use the HTML Entity Encoder

To use the HTML Entity Encoder, simply paste your text or HTML into the input area on the left. Choose a mode - Encode (essential characters), Decode, Encode All (every character), or Named Entities. View the result - the converted output appears instantly on the right. Copy or download - use the buttons above the output to copy or save the result.

When to Use the Tool in Real Workflows

Use the HTML Entity Encoder when you need to ensure that text is displayed correctly in HTML documents. This is particularly important when dealing with user input that may contain special characters that could otherwise be misinterpreted as HTML markup. Additionally, it's useful for creating HTML content programmatically, ensuring that all characters are properly encoded.

How It Works

The HTML Entity Encoder works by taking the text or HTML you input and converting it into a format that is safe to display in an HTML document. This is done by replacing special characters with their corresponding HTML entities. For example, the less-than sign (<) is replaced with &lt;, and the greater-than sign (>) is replaced with &gt;. This ensures that the browser renders the text as literal text rather than HTML markup.

Tips, Edge Cases, or Limitations

Always ensure that any user-supplied text is encoded before inserting it into an HTML document to prevent cross-site scripting (XSS) vulnerabilities. The Encode All mode can be useful for obfuscating email addresses from spam crawlers, but it will make the output much longer. Be aware that HTML entities are not the same as URL encoding; use the appropriate tool for the task at hand.

Frequently Asked Questions

HTML entities are special text sequences used to represent characters that have special meaning in HTML or that cannot easily be typed directly. Every entity begins with an ampersand (&) and ends with a semicolon (;).
Named HTML entities are represented by their names (e.g., &copy; for ©), while numeric HTML entities are represented by their decimal or hexadecimal numeric references (e.g., &#169; for ©).
You need to encode HTML entities when you are inserting user input into an HTML document to prevent browsers from misinterpreting it as markup. This is particularly important for preventing cross-site scripting (XSS) vulnerabilities.
Yes, this HTML entity encoder is safe to use with sensitive data. It only converts characters to their corresponding HTML entities and does not alter the data in any other way.
The "Encode All" mode converts every character to its numeric entity (e.g., &#NNN;). This makes the output much longer but ensures that the text is safe in any HTML context. It is sometimes used to obfuscate email addresses from spam crawlers.

Quick reference

HTML Entity Encoder / Decoder Quick Reference
Entity Name Entity Code Description Common Use
< < Less-than sign Representing < in HTML
> > Greater-than sign Representing > in HTML
& & Ampersand Representing & in URLs/HTML
© © Copyright symbol Marking copyrighted content
® ® Registered trademark Indicating registered trademarks
¥ ¥ Japanese Yen symbol Representing currency in text