Developer Tools

HTML Entity Encoder & Decoder

Encode special characters to HTML entities and decode them back. Convert < > & " and all named entities instantly in your browser.

Input
Output

What is HTML Entity Encoder & Decoder?

HTML entities are text representations of characters that have special meaning in HTML or cannot be typed directly. The characters <, >, &, " and ' must be escaped as &lt;, &gt;, &amp;, &quot; and &#39; respectively when used as literal content — otherwise the browser interprets them as HTML syntax. This tool handles the encoding and decoding of all standard named entities and numeric character references.

HTML entity encoding is necessary when displaying code examples in web pages, embedding user-generated content safely, storing HTML-containing strings in JSON or XML, and preventing XSS vulnerabilities by ensuring special characters aren't interpreted as markup. It's also useful in reverse — decoding entities to read the actual content of heavily encoded strings from APIs or scraping output.

All processing happens locally in your browser. Paste your text, choose encode or decode, and the result updates instantly. The tool handles both named entities (&amp;amp;) and numeric references (&#38;) in both directions.

How to use

1
Paste your text
Enter the text you want to encode or decode in the input area.
2
Select mode
Choose Encode to convert special characters to entities, or Decode to reverse the process.
3
Copy the result
The output updates instantly. Click Copy to copy the result to clipboard.

Frequently asked questions

QWhat characters get encoded?

At minimum: & → &amp;, < → &lt;, > → &gt;, " → &quot;, ' → &#39;. Extended mode also encodes accented characters, symbols, and non-ASCII characters.

QWhat's the difference between named and numeric entities?

&amp; is a named entity. &#38; is the decimal numeric equivalent. Both represent the same character. Named entities are more readable; numeric references work for any Unicode character.

QIs my data safe?

Yes. All encoding and decoding runs locally in your browser. Nothing is sent to any server.

QCan this help prevent XSS?

Yes. Encoding user input before inserting it into HTML prevents script injection. Always encode on the server too — client-side encoding alone is not sufficient security.

Found a bug or issue with this tool?
If something isn't working as expected, let us know and we'll fix it.
Report this bug
Embed this tool

Copy and paste this iframe code into your website.

<iframe   src="https://usetool.space/embed/developer/html-entity"  width="100%"   height="860px"  frameborder="0"  loading="lazy"  title="HTML Entity Encoder & Decoder — useTool"></iframe>
✨ Missing something?
Can't find the tool you need?
Request it — we build new tools based on what people ask for.
Request a tool