HTML Entities Encoder & Decoder
Convert special characters, markup tags, and extended Unicode symbols to named, decimal, and hexadecimal HTML entities without accidental DOM execution or XSS exposure.
Standard HTML5 Entity Cheat Table
Instant reference table for W3C markup delimiters, typography, mathematical sets, and symbols.
| Character | Named Reference | Decimal Code | Hex Code | W3C Description | Quick Insert |
|---|---|---|---|---|---|
| & | & | & | & | Ampersand delimiter (Critical) | |
| < | < | < | < | Opening tag delimiter (Critical) | |
| > | > | > | > | Closing tag delimiter (Critical) | |
| " | " | " | " | Attribute quote enclosure (Critical) | |
| ' | ' | ' | ' | Attribute apostrophe delimiter (Critical) | |
| ␣ | |   |   | Non-breaking white space | |
| © | © | © | © | Copyright symbol | |
| ® | ® | ® | ® | Registered trademark sign | |
| € | € | € | € | Euro currency symbol | |
| — | — | — | — | Em dash typographic separator |
Deep-Dive: Escaping Mechanisms in Web Engines
The Five XML/HTML Critical Characters and XSS Defense
Standard markup lexers treat < and > as syntactic delimiters for DOM element boundaries. When user-supplied text enters an HTML document unescaped, an attacker can break out of string context to execute malicious inline scripts (<script>) or hijack event handlers.
Equally insidious are unescaped quote literals (" and ') inside attribute nodes like value="INPUT", allowing an attacker to inject " onmouseover=".... Escaping the foundational 5 characters neutralizes markup breakout at zero runtime performance penalty.
Named vs Numeric Entities: Why Hex Is Universally Portable
While named character references such as € or ™ are human-legible, XML parsers (including strict SVG and XHTML runtimes) only natively acknowledge five named entities without an explicit DTD schema declaration.
In contrast, numeric entities—both decimal (€) and hexadecimal (€)—map explicitly to ISO 10646 and Unicode code points. Hexadecimal representation corresponds 1:1 with standard UTF-16 surrogate pairs and UTF-32 hex references, making it the most resilient format across legacy mainframes, XML parsers, and micro-embedded web views.
Decoding Entities Without innerHTML To Prevent Client-Side Exploits
A frequent yet disastrous anti-pattern found in developer tools is delegating entity decoding to a phantom browser DOM element via el.innerHTML = input; return el.textContent;. If an unvetted payload includes active elements like <img src=x onerror=alert(1)>, the DOM parser initiates asynchronous execution in memory.
ToolAcre implements an air-gapped synthetic tokenizer. We decode hexadecimal/decimal codepoints via direct native String.fromCodePoint() and resolve named references through a static immutable hash dictionary. The browser DOM tree is never traversed or queried, completely precluding DOM-based execution.
Direct Character-Stream Pipeline
Every string transformation executes synchronously on worker memory. No sockets, no local-storage caching, no analytics probes on payload bodies. Inspect the execution flowchart below to see how raw strings are segmented and resolved.
Related Developer Utilities
Local client transformations for markup, encodings, and network protocols.
URL Encoder / Decoder
RFC 3986 percent-encoding for URI query strings, path components, and UTF-8 escape sequences.
Base64 Encoder / Decoder
Standard and URL-safe Base64 conversions for text payloads, binary buffers, and data URLs.
JSON Formatter & Validator
Syntax highlighting, strict validation against RFC 8259, and payload minification.
SHA-256 / SHA-512 Generator
Cryptographic Web Crypto API digest computation for raw text, binary files, and secrets.