Encode special characters to HTML entities or decode them back. 100% browser-based — your text never leaves your device.
Input
0 chars
Output
0 chars
Copied!
Common HTML Entities
| Character | Named Entity | Numeric (Dec) | Description |
|---|
How to Use
- Paste your HTML or plain text into the Input panel.
- Click "Encode" to convert special characters to HTML entities.
- Click "Decode" to convert HTML entities back to plain characters.
- Enable "Encode all non-ASCII" to also encode accented and Unicode characters.
- Use "Swap" to move output to input for chained operations. Use "Copy" to copy the result.
Features
- Encodes all HTML-critical characters: < > & " '
- Optional: encode all non-ASCII characters for maximum compatibility.
- Supports both named entities (&) and numeric entities (&).
- Real-time character count for both input and output.
- Quick reference table for the most common HTML entities.
- All processing happens in your browser — no server, no tracking, no data stored.
Use Cases
- Sanitizing user-generated content before inserting into HTML to prevent XSS attacks.
- Displaying code snippets or HTML source code inside web pages without breaking layout.
- Decoding HTML from APIs or scraped web content back into readable text.
- Embedding special characters (©, ®, €, ←) in HTML without encoding issues.
- Teaching HTML encoding to students or verifying entity conversions.
FAQ
- What are HTML entities?
- HTML entities are codes that represent characters with special meaning in HTML. They start with & and end with ;. For example, < represents <, & represents &, and © represents ©.
- When do I need to encode HTML entities?
- Always encode < > & " ' when displaying user-generated content in HTML to prevent XSS attacks. Also encode when embedding HTML code examples in web pages.
- What is the difference between named and numeric entities?
- Named entities use descriptive names like & or ©. Numeric entities use the Unicode code point, either decimal (©) or hex (©). Named entities are more readable; numeric works for any character.
- Is my text sent to a server?
- No. All encoding and decoding is done entirely in your browser with JavaScript. Your text never leaves your device.
- Does this tool handle Unicode characters?
- Yes. With "Encode all non-ASCII" enabled, all Unicode characters (emojis, accented letters, CJK characters, etc.) are encoded as numeric entities. Without this option, only the five HTML-critical characters are encoded.