Skip to content
DevToolKit

HTML Entity Escape & Unescape

Encode and decode HTML entities with precision. Supports named, decimal, and hex formats. Unicode-aware escaping for emojis and international characters.

Configuration

Attribute SafeEscape " and '
Input

Result

Waiting for input...
Length: 0 characters

Unicode-Aware

Correcty handles 32-bit surrogate pairs (emojis) so they don't break into corrupted halves.

Standard Compliant

Supports all HTML5 named entities, plus robust decimal and hex numerical references.

Was this tool helpful?

How to Use

The Professional HTML Entity Escape & Unescape tool is designed for developers who need precise control over character encoding for web content and attributes.

How to use this tool

  1. Select Mode: Choose between Encode (to escape text) and Decode (to restore entities to plain text).
  2. Entity Format: Choose how you want characters to be represented: Named (like ©), Decimal (like ©), or Hexadecimal (like ©).
  3. Set Level: Control which characters are affected. You can escape only the critical special characters (< > &), all non-ASCII characters (including emojis), or everything in the input.
  4. Attribute Safe Toggle: Enable this to ensure that quotes (") and apostrophes (') are escaped, making the output safe for use inside HTML attributes.
  5. Copy: Use the one-click copy button to grab your results instantly.

About This Tool

What are HTML Entities?

HTML entities are used to display reserved characters that would otherwise be interpreted as HTML code by the browser. For example, to display a less-than sign (<), you must use the entity &lt;.

Entities are also used to represent characters not present in the character encoding of the page, ensuring that international text and symbols are displayed correctly across all devices and browsers.

Why Use This Tool

Unicode & Emoji Support

Many online encoders fail when processing 32-bit characters like modern Emojis, often breaking them into two invalid "surrogate" entities. Our tool is built with a **Unicode-aware engine** that correctly identifies 32-bit code points, ensuring your emojis and international scripts remain perfectly intact during the encoding process.

FAQ

What are HTML entities?
HTML entities are character sequences that represent special characters with meaning in HTML. For example, < is written as &lt; and & as &amp; to prevent the browser from interpreting them as HTML code.
When do I need to escape HTML?
Whenever you display user-generated content on a web page. Without escaping, an attacker could inject malicious JavaScript (XSS). It is also necessary when embedding HTML inside XML attributes or writing technical documentation.
What is the difference between named, decimal, and hexadecimal entities?
Named entities use readable names (&amp;, &lt;). Decimal entities use the Unicode code point (&#38;, &#60;). Hexadecimal entities use the hex representation of the code point (&#x26;, &#x3C;). All produce the same visual result.