encode | decode | compress

> <html> | &entity; | © <

// HTML Entity - Encode special characters for safe HTML display

[SAFE]

XSS Prevention

Prevent cross-site scripting attacks by encoding special characters.

[COMPLETE]

All Formats

Support for named, decimal, and hexadecimal entity formats.

[UNICODE]

Full Unicode

Encode any Unicode character including emojis and symbols.

>> technical info

How HTML Entities Work:

HTML entities allow you to display reserved characters that have special meaning in HTML. They start with & and end with ; and can be named (&lt;), numeric (&#60;), or hexadecimal (&#x3C;).

Examples:

< → &lt; > → &gt; & → &amp; " → &quot; © → &copy;

Why Use HTML Entities:

  • >Display HTML code snippets
  • >Prevent XSS attacks
  • >Show special characters
  • >Email template safety
  • >RSS feed compatibility

>> frequently asked questions

What are HTML entities?

HTML entities are special codes that represent reserved characters in HTML. They allow you to display characters that would otherwise be interpreted as HTML code, like < > & and quotes.

When should I use HTML entities?

Use HTML entities when displaying user-generated content, showing code examples in HTML, preventing XSS attacks, or ensuring special characters display correctly across different browsers and systems.

What's the difference between named and numeric entities?

Named entities use memorable names (< for <), numeric entities use decimal codes (<), and hex entities use hexadecimal (<). All represent the same character but named entities are more readable.

Do I need to encode all special characters?

At minimum, encode < > & " and ' in HTML content. For attributes, also encode spaces and other special characters. For maximum safety, encode all non-ASCII characters.

Other Languages