SpeedDrain
Security · XSS Sanitizer · In-Browser

HTML Entity Encoder & Decoder

Convert reserved characters into named entities, decimal codes, and hexadecimal references. Protect web applications against Cross-Site Scripting (XSS) and decode scrambled entity strings.

Presets:
120 chars
182 chars (15 entities)

Quick Entity Reference & Insert Palette

HTML Entity Reference & Security Essentials

Why HTML Entity Encoding is Essential for XSS Prevention

When web browsers render HTML, characters like <, >, and " are interpreted as document tags and attribute delimiters. If untrusted user input is directly inserted into an HTML page without escaping, an attacker can inject malicious <script> tags or attribute event handlers (e.g., onload, onerror).

Encoding these characters into their respective HTML entities (&lt;, &gt;, &amp;) instructs the browser to render the literal symbol rather than executing it as markup.

Named Entities vs. Numeric Character References (NCR)

Named Entities

Human-readable entity names like &copy; and &euro;. Easy to remember and read in source files, but only a subset of Unicode glyphs possess named equivalents.

Decimal Codes

Base-10 Unicode codepoints formatted as &#60;. Supported across all HTML and XML parsers without requiring external entity definitions.

Hexadecimal Codes

Base-16 codepoints formatted as &#x3C;. Directly aligns with standard Unicode notation (U+003C) and is frequently used in web scraping and security payloads.