Encode and decode HTML entities and special characters

0 characters

Common HTML Entities

&Ampersand
&
<Less than
&lt;
>Greater than
&gt;
"Double quote
&quot;
'Single quote
&#39;
©Copyright
&copy;
®Registered
&reg;
Trademark
&trade;
Euro
&euro;
Non-breaking space
&nbsp;

About HTML Entity Encoding

HTML entities are used to display reserved characters in HTML. Special characters like <, >, and & must be encoded to prevent them from being interpreted as HTML code.

Features

  • Encode special characters to HTML entities
  • Decode HTML entities back to characters
  • Supports named entities (&copy;) and numeric entities (©)
  • Instant conversion
  • Swap between encoded and decoded formats
  • Common entities reference table
  • 100% browser-based (secure and private)

Common Use Cases

  • Displaying code snippets in HTML
  • Preventing XSS (Cross-Site Scripting) attacks
  • Email templates with special characters
  • XML and HTML document creation
  • Escaping user-generated content
  • Showing HTML source code on web pages

Example

Original:<div>Hello & Goodbye</div>
Encoded:<div>Hello & Goodbye</div>
Security Note: Always encode user input before displaying it in HTML to prevent XSS attacks. This is a critical security practice for web development.