HTML Entity Encoder / Decoder
Encode special characters into HTML entities or decode entities back to readable text. Use Special chars mode for the five critical characters (< > & " '). Use All characters mode to convert every character into its numeric entity (&#NNN;).
Named vs Numeric Entities
Named entities like <, >, & cover the five critical HTML characters and are the most common form of encoding. Numeric entities (&#NNN;) can represent any Unicode code point — useful for obscuring content from naive parsers or encoding characters outside ASCII. Both forms are decoded identically by browsers.
Raw text or HTML — may contain characters with special meaning in HTML markup
Each character checked against the five critical HTML characters: <, >, &, ", and '
Special characters replaced with named entities (<, >, &, ", ') or numeric entities (&#NNN;)
Special-chars mode encodes only the 5 critical characters. All-characters mode converts every character to its numeric entity
Encoded string safe for embedding in HTML — browsers render entities as text, not markup
String containing HTML entities — named (<), decimal (<), or hexadecimal (<)
Each & ... ; sequence identified as a named or numeric entity reference
Named entities resolved via the HTML entity table. Numeric entities converted from code point to character
All entity references replaced with their corresponding Unicode characters
Human-readable string with all entities decoded — original characters restored
Spec: HTML Living Standard §13.5 (named character references), Unicode Standard