HTML Entity Encoder / Decoder
Convert special characters to HTML entities and back.
Common Entities Reference ▸
&&
<<
>>
""
''
©©
®®
™™
€€
££
¥¥
°°
±±
××
÷÷
→→
←←
↑↑
↓↓
↔↔
About This Tool
HTML entities are special sequences representing characters that have reserved meaning in HTML, or characters not easily typed on a keyboard. They ensure browsers render the intended character rather than misinterpreting it as HTML markup.
When to Use
- Escaping user-provided text before inserting into HTML to prevent XSS (Cross-Site Scripting).
- Displaying code snippets with < and > characters in HTML.
- Embedding copyright (©), trademark (™), or currency (€) symbols.
Practical Examples
XSS Prevention<script>alert(1)</script> → <script>alert(1)</script> (safe to display)
Typographic"Hello" → "Hello" - required in HTML attributes
Common Mistakes to Avoid
- Double-encoding: running encode twice turns & → & → &amp;.
- Forgetting to escape user input in server-rendered HTML leads to stored XSS vulnerabilities.
Frequently Asked Questions
Q. When should I use &#number; vs &name;?A. Named entities (&) are more readable. Numeric entities (&) are portable across all parsers. Both are equivalent.