HTML entity encoder and decoder
Escape five markup characters or decode HTML5 character references as plain text
All input is processed in this browser and is never sent to a server or written to local storage.
Enter data or load the example, then process it.
Up to 100,000 UTF-16 units. Decoded markup is displayed only as text.
Supported input and rules
Encoding replaces &, <, >, double quotes and apostrophes while preserving other Unicode text. Decoding recognizes HTML5 named and decimal or hexadecimal numeric references with a terminating semicolon. Unknown names remain literal; invalid numeric references follow HTML5 replacement rules.
How to use the result
Choose encoding or decoding, paste text and process. The result stays in a read-only text field: decoded tags are never inserted into the page as markup. Copy or download the text for the specific destination you intend to use, and check whether that destination expects escaped or literal characters.
Worked example
Encoding <b>A&B</b> produces <b>A&B</b>. Decoding 😀 produces 😀. Processing &lt; once produces <, not a less-than sign: this is a single pass, so nested references need a deliberate second operation.
Scope and limitations
This is a character-reference converter, not an HTML sanitizer or a complete XSS defense. Different HTML, JavaScript, CSS and URL contexts require different handling. It does not render a preview, load referenced images, repair malformed markup or change the character encoding of a file.