HTML Entity Encoder and Decoder
Convert reserved characters and symbols to HTML-safe entity references, or decode entities back to readable text. This helps when placing literal markup characters in HTML or debugging escaped content.
How to use this tool
- Enter text containing characters you want to encode or existing entities you want to decode.
- Choose the encode or decode operation.
- Review and copy the result for your HTML, template, or documentation.
Tips
- Encode user-provided text before inserting it into an HTML context to reduce markup interpretation risks.
- Entity encoding is context-dependent; JavaScript, CSS, and URL values need their own escaping rules.
Frequently asked questions
What does HTML entity encoding do?
It represents characters such as <, >, &, and quotes with entity references so browsers can display them as text instead of interpreting them as markup.
Is this an HTML sanitizer?
No. It encodes or decodes text, but it is not a complete sanitizer or a replacement for context-aware output escaping.