JustFreeTools.
◎   English
EnglishEspañolالعربية
← All tools
Developer

HTML entity encoder & decoder — escape and unescape text

Encode HTML special characters or decode named, decimal and hexadecimal entities. Unicode support, copy and TXT download. Free, private and browser-only.

● Your files stay yours

Loading converter…

Escapes &, <, >, double quotes and single quotes. Existing entities are encoded again.

Paste text or try the example.

The result is plain text. This is an entity converter, not an HTML sanitizer or a JavaScript, CSS or URL escaper.

How to use this tool

Paste text, choose Encode or Decode, and convert. Encode escapes ampersands, angle brackets and both quote marks. Choose ASCII output to also encode non-ASCII characters. Copy, download as TXT, or use the result as input to reverse the direction. Ctrl/Command + Enter converts from the input box.

Good to know

Up to 500,000 UTF-16 code units per input. Decoding requires semicolons, is case-sensitive and runs once; unknown names and incomplete references remain unchanged. Invalid numeric code points become the replacement character; legacy numeric references follow HTML mappings. Encoding rejects nulls and unpaired surrogates; ASCII mode also rejects legacy control characters that would change when decoded. Text stays in your browser and is not saved.

Common HTML entities

CharacterNamed entityDecimal entity
&&amp;&#38;
<&lt;&#60;
>&gt;&#62;
"&quot;&#34;
'&apos;&#39;
©&copy;&#169;
€&euro;&#8364;

HTML encoding and decoding questions

What is HTML entity encoding?

It replaces characters with references that HTML interprets as characters. For example, < becomes &lt; and & becomes &amp;. Use this when displaying literal markup in HTML text or preparing text for quoted attribute values; it does not validate URLs or sanitize HTML.

What types of entities can I decode?

Named references such as &copy;, decimal references such as &#169;, and hexadecimal references such as &#xA9;. All three give ©. The local table includes 2,125 semicolon-terminated HTML names, including references that contain two Unicode code points.

Why does &amp;lt; become &lt; instead of < ?

The decoder deliberately processes one layer at a time. Use the result as input, select Decode again and convert to remove another layer. Repeated automatic decoding could change text you intended to keep. Encoding always treats the input as literal text, including existing references.

Does decoding remove HTML tags or run scripts?

No. Tags remain text, and nothing is rendered or executed. The output is not sanitized: use appropriate validation and escaping before inserting it into a website.

Why are some entities unchanged or replaced?

Names are case-sensitive and must end with a semicolon. Unknown names and malformed references are kept. Numeric zero, surrogate values and numbers above U+10FFFF become �; legacy numeric codes such as &#128; map to € under HTML rules.

How do I encode emoji and Arabic text?

Special-characters-only mode leaves Unicode readable. ASCII output uses hexadecimal numeric references for non-ASCII code points, so 🙂 becomes &#x1F642;. Combining marks are handled as separate code points.