Encode and decode HTML entities.

How HTML Encoder Works
What is HTML Encoding?

HTML encoding converts special characters into their HTML entity equivalents so they display correctly in web pages instead of being interpreted as markup. For example, < becomes &lt; and & becomes &amp;.

This is essential for preventing XSS (Cross-Site Scripting) attacks and ensuring user-supplied content renders safely in browsers.

How to Use
  • Paste text or HTML into the input field.
  • Click Encode to convert special characters to HTML entities, or Decode to convert entities back to characters.
  • Enable Encode Quotes to also convert single and double quotes.
  • Enable All Non-ASCII to convert every character outside the ASCII range to numeric entities.
  • The output updates live as you type.
Encoded Characters
&&amp; - Ampersand (always encoded)
< >&lt; &gt; - Angle brackets (always encoded)
" '&quot; &#39; - Quotes (optional)
Non-ASCII&#NNN; - Numeric entities for extended characters
Important Notes
  • HTML encoding prevents browsers from interpreting text as markup, which is critical for security when displaying user input.
  • Decoding converts named entities (&amp;) and numeric entities (&#38;) back to their original characters.
  • Always encode user-generated content before inserting it into HTML to prevent XSS vulnerabilities.
Privacy & Security: All encoding and decoding runs entirely in your browser. No data is sent to any server.
Mode
Options