Skip to main content
I
Uni
UNICODE
Tools/HTML Entities

HTML Entity & Character Reference Studio

Encode text into Named HTML5 entities (©, &), Decimal (&#NNN;), and Hex (&#xNNN;), or decode entities back to plain Unicode text.

15HTML Entities Detected
70Unicode Characters
namedActive Entity Format
W3C HTML5Standard Spec
Entity Formatting Standard:
Quick Presets:
Font Size (16px):
Plain Unicode Text (To Encode)Live Input Buffer
Encoded HTML Entities Output
<div class="box">© 2026 Acme Corp.™ & €99.99 — "Fast & Secure" 🚀</div>

Character-by-Character HTML Entity Anatomy

GlyphUnicode CodepointDecimal ReferenceHexadecimal ReferenceNamed Entity
<U+003C&#60;&#x3C;&lt;
dU+0064&#100;&#x64;
iU+0069&#105;&#x69;
vU+0076&#118;&#x76;
U+0020&#32;&#x20;
cU+0063&#99;&#x63;
lU+006C&#108;&#x6C;
aU+0061&#97;&#x61;
sU+0073&#115;&#x73;
sU+0073&#115;&#x73;
=U+003D&#61;&#x3D;
"U+0022&#34;&#x22;&quot;
bU+0062&#98;&#x62;
oU+006F&#111;&#x6F;
xU+0078&#120;&#x78;
"U+0022&#34;&#x22;&quot;
>U+003E&#62;&#x3E;&gt;
©U+00A9&#169;&#xA9;&copy;
U+0020&#32;&#x20;
2U+0032&#50;&#x32;
0U+0030&#48;&#x30;
2U+0032&#50;&#x32;
6U+0036&#54;&#x36;
U+0020&#32;&#x20;
AU+0041&#65;&#x41;

HTML Entities Encoding & Decoding

Using standard library html module.

1import html
2
3raw = '<div class="greeting">Hello & "Welcome" © 2026</div>'
4
5# 1. Escape HTML special characters
6escaped = html.escape(raw, quote=True)
7print("Escaped:", escaped)
8
9# 2. Unescape entities back to plain text
10restored = html.unescape(escaped)
11assert restored == raw
Python 3Zero external runtime dependencies • Standard Library
UTF-8 & Unicode 16.0 Compatible

The Architecture of HTML Character Entities & Security (W3C HTML5)

In the HTML5 specification (Section 12.1.4), Character References allow authors to include characters that are either impossible to type directly on standard keyboards or reserved by HTML markup syntax.

1. XSS Security & Markup Escaping:The 5 fundamental XML/HTML entities — &lt; (<), &gt; (>), &amp; (&), &quot; ("), and &apos; (') — prevent malicious scripts from executing in browsers.
2. Typography & Mathematical Symbols:Entities like &copy; (©), &euro; (€), &mdash; (—), and &infin; (∞) ensure flawless cross-platform typography.

Decimal vs. Hexadecimal vs. Named References

  • Named Entities: Human-readable (e.g. &trade;). Supported across all HTML5 parsers.
  • Decimal References: Format &#NNN; (e.g. &#169;). Supported in XML, SVG, and HTML.
  • Hexadecimal References: Format &#xNNN; (e.g. &#xA9;). Directly maps to Unicode codepoint hex numbers.
  • Emoji & CJK Support: Easily encode 4-byte astral plane emojis like 🚀 (&#128640; / &#x1F680;).

Frequently Asked Questions (FAQs)

Why should I escape HTML entities in web applications?+

Unescaped user input can lead to Cross-Site Scripting (XSS) vulnerabilities where malicious users inject JavaScript tags (<script>) into your website. Escaping < to &lt; ensures the code renders safely as plain text.

Can I decode mixed documents containing named, hex, and decimal entities simultaneously?+

Yes! Select the "Decode" mode. Our parser automatically resolves all W3C named references (&copy;), decimal codes (&#169;), and hex references (&#xA9;) in a single pass.

What is the entity for the non-breaking space?+

The non-breaking space (U+00A0) is represented by the named entity &nbsp; or decimal &#160;. It prevents automatic line breaks between adjacent words.