HomeHTML Encode/Decode

HTML Encode/Decode

Convert special characters to HTML entities to prevent XSS attacks, supports named, decimal and hexadecimal entities

About HTML Encoding

HTML encoding is the process of converting special characters into HTML entities. Some characters have special meanings in HTML (such as < and >), and if used directly in HTML, they may break the page structure or cause security issues.

By converting these characters to their corresponding HTML entities, browsers can display them correctly without interpreting them as HTML tags. This is an important security measure in web development to prevent XSS (Cross-Site Scripting) attacks.

Security Tip: Always HTML encode user input before displaying it on a webpage. This is a fundamental security measure to prevent XSS attacks.

Common Use Cases

  • Prevent XSS (Cross-Site Scripting) attacks
  • Display special characters and symbols in HTML
  • Safely include quotes in attribute values
  • Display HTML code examples without executing them
  • Handle user input containing special characters

Entity Type Descriptions

Named Entities

Use memorable names, good readability, but not all characters have named entities

&lt; &gt; &amp; &nbsp;

Decimal Entities

Use character's Unicode code point (decimal), applicable to all characters

&#60; &#62; &#38; &#160;

Hexadecimal Entities

Use character's Unicode code point (hexadecimal), consistent with CSS and JavaScript

&#x3C; &#x3E; &#x26; &#xA0;

Common HTML Entities Reference

CharacterNamed EntityDecimalHexadecimalDescription
<&lt;&#60;&#x3C;Less than (tag start)
>&gt;&#62;&#x3E;Greater than (tag end)
&&amp;&#38;&#x26;Ampersand (entity start)
"&quot;&#34;&#x22;Double quotation mark
'&apos;&#39;&#x27;Single quotation mark/apostrophe
 &nbsp;&#160;&#xA0;Non-breaking space
©&copy;&#169;&#xA9;Copyright symbol
®&reg;&#174;&#xAE;Registered trademark symbol
&trade;&#8482;&#x2122;Trademark symbol

Data is processed locally in your browser by default and will not be uploaded to any server. Upload will be clearly indicated if required.

© 2026 See-Tool. All rights reserved. | Contact Us