HTML Entity Encoder
Escape text for HTML, or encode every character as a numeric reference.
How to use it
- Paste your input, or load the example.
- Choose the options that match your task.
- Select Encode entities, then review the result.
- Copy the result or download html-entity-encoder.txt.
Escaping HTML text
Special-character mode escapes ampersands, angle brackets, double quotes and single quotes. All-character mode uses decimal Unicode code point references, including for spaces and line breaks. Existing entities are escaped again. This is useful for HTML text and quoted attributes, not JavaScript, CSS or URL contexts. It does not sanitize an HTML document.