HTML Encoder / Decoder
Free online HTML entity encoder and decoder. Instantly encode special characters to HTML entities (&, <, >, ") or decode them back. Supports named and numeric entities.
Input
Output
Enter text to encode or decode
How to Use
Choose mode
Select "Encode" to convert special characters to HTML entities, or "Decode" to convert entities back to plain text.
Paste text
Enter your text in the input field. The result updates automatically.
Copy the result
Click "Copy" to copy the output, or "Swap" to reverse the input and output.
FAQ
HTML entities are special character sequences used to represent characters that have special meaning in HTML (such as < and >) or that are not easily typed. For example, & becomes &, < becomes <, and > becomes >.
You need to encode HTML when displaying user-generated content, inserting text into HTML attributes, or preventing XSS (cross-site scripting) vulnerabilities. Always encode untrusted input before inserting it into HTML.
Named entities use a readable name (e.g., &amp;, &lt;). Numeric entities use the Unicode code point (e.g., &#38;, &#60;). Both are valid HTML. Named entities are more readable; numeric entities work for any character.
This tool correctly encodes characters that can cause XSS (& < > " '). However, proper XSS prevention also depends on context (HTML attributes, JavaScript, CSS) and should be handled by your server-side framework.