Web
HTML Entity Encoder & Decoder
Escape five markup-sensitive characters or decode common and numeric references without rendering the result as HTML.
About this tool
When to use it
Escape five markup-sensitive characters or decode common and numeric references without rendering the result as HTML.
How to use it
Choose Encode or Decode, paste the source, and run the action. Use output as input to reverse the operation on the current result. Inspect the destination context before inserting output into a page.
Guide updated . Examples checked against this implementation.
Worked examples
Escape a small markup fragment
Input
<b>A & B</b>Expected output
<b>A & B</b>Encoding makes angle brackets and the ampersand visible as text when interpreted in an appropriate HTML text context.
Errors and unsupported input
© is not decodedOnly amp, lt, gt, quot, apos and numeric references are handled. Use a full HTML parser when the complete named-entity set is needed.
Continue this workflow
- Markdown to HTML Converter: Generate actual markup from Markdown when rendering is intended.
Questions
Frequently asked questions
Why does encoding twice produce &lt;?
The second pass escapes the ampersand in the first result. Apply encoding once at the appropriate output boundary.