Practical guide
Using the HTML Entity Encoder / Decoder
Convert reserved characters to and from HTML entities.
Example
Input
<p title="A & B">Hello</p>Expected result
<p title="A & B">Hello</p>Supported inputs
- Text to encode for the reserved characters &, <, >, double quote, and apostrophe.
- Common named entities and decimal or hexadecimal numeric references for decoding.
Limitations
- Only a small set of named entities is decoded; unknown names are left unchanged.
- Encoding reserved characters does not sanitize content for every HTML context.
Frequently asked questions
Does encoding HTML entities make input safe everywhere?
No. Correct escaping depends on the output context. This utility handles common HTML characters, not complete context-aware sanitization.
Why was a named entity not decoded?
The decoder recognizes a limited set of common names plus numeric character references; unsupported names remain unchanged.