HTML Entity Encoder / Decoder
Convert special characters to HTML entities and back. Supports named, numeric, and UTF-8 entities.
What is HTML Entity Encoding?
HTML entity encoding replaces special characters with their corresponding HTML entity codes. This is essential when displaying code snippets, preventing XSS attacks, or embedding content that contains characters with special meaning in HTML.
Common HTML Entities
<- Less than sign (<)>- Greater than sign (>)&- Ampersand (&)"- Double quotation mark (")'- Single quote / apostrophe (') - Non-breaking space©- Copyright symbol (©)™- Trademark symbol (™)
Why Use Entity Encoding?
- XSS Prevention - Escape user input before rendering in HTML
- Displaying Code - Show HTML/CSS/JS code without it being interpreted
- Email Templates - Safely embed content in HTML emails
- Content Management - Store safe text for web display
Frequently Asked Questions
What is the difference between named and numeric entities?
Named entities use descriptive names like < for less-than. Numeric entities use decimal or hex codes like < or <. Both produce the same character. Named entities are more readable; numeric entities support any Unicode character.
Does this tool support Unicode characters?
Yes. This tool supports all Unicode characters including emoji, accented characters, and non-Latin scripts. UTF-8 characters are encoded using their numeric HTML entity equivalents.
Is my data sent to a server?
No. All encoding and decoding happens entirely in your browser using JavaScript. No data is ever transmitted to any server.