HTML Encoder/Decoder
Online HTML Entity Encoding and Decoding Tool, featuring smart automatic detection, three encoding formats, file upload and download, and a reference table of over 200 HTML entities
Input Text
Output Result
??? Visual Preview — How encoded output renders in browser
Collapse —?? HTML Entity Reference (Click to Expand)
—What is HTML entity encoding/decoding?
HTML Entity is a text string that begins with & and ends with ;, used to display reserved characters in HTML documents (such as <, >), or to represent characters that are difficult to type on a keyboard (such as ©, €).
Encode: Replaces special characters in HTML with their corresponding HTML entities, preventing the browser from parsing them as HTML tags.
Decode: Converts HTML entities back to their original characters, making it easier to view and edit the actual content.
6 Characters That Must Be Escaped
| Character | Named Entity | Decimal Entity | Hex Entity | Description |
|---|---|---|---|---|
| & | & | & | & | Ampersand |
| < | < | < | < | Less than |
| > | > | > | > | Greater than |
| " | " | " | " | Double quote |
| ' | ' | ' | ' | Single quote |
Common Use Cases
- XSS Prevention — Encode
<>in user input to safely embed into HTML pages - Display Code on Web Pages — Show HTML code snippets without the browser rendering them as actual elements
- Secure Data Transmission — Encode text containing special characters before storage or transmission
- Template Development — Encode dynamic HTML content when embedding it in templates
How to use
- 1. Paste text or HTML
- 2. Choose encode or decode
- 3. Copy the result
Example
When do I need encoding? Does it touch non-ASCII text?`FAQ
When displaying user input or code samples, to stop the browser treating them as markup.
Only special characters are escaped; UTF-8 text is left as is.
Related tools
- 🔐Base64 Encode/DecodeFree online Base64 encoder and decoder
- 🔐URL Encode/DecodeFree URL encoder and decoder
- 💻Code HighlighterFree online code syntax highlighter
- 💻Code to ImageFree online code-to-image converter
- 📋JSON FormatterFree online JSON formatter, validator and beautifier
- 📝Regex TesterFree regex tester with real-time match highlighting, capture…
- 📝Find & ReplaceFree online find and replace tool
- 📝Text Sort & DedupFree online text sorter and deduplicator
Related tutorials
🙏 帮我们做得更好
如果您发现了,麻烦告诉我们,我们会在收到反馈后第一时间进行修复,再次感谢您的光临 🙏