HTML Entities Encoder/Decoder

Convert text to HTML entities and decode HTML entities back to text

Try these examples:

About HTML Entities

HTML entities are special characters that are used in HTML to represent characters that might otherwise be interpreted as HTML code. They allow you to display reserved characters, which would otherwise be interpreted as HTML code, and invisible characters like non-breaking spaces.

Common Uses of HTML Entities

  • Displaying reserved characters like <, >, &
  • Adding special characters like copyright (©) or trademark (™)
  • Including characters from different languages or writing systems
  • Adding mathematical symbols or technical notations
  • Ensuring consistent rendering across different browsers and platforms

How HTML Entities Work

HTML entities can be referenced in two ways:

  • Named entities: Begin with an ampersand and end with a semicolon (e.g., &lt; for <)
  • Numeric entities: Use decimal or hexadecimal values (e.g., &#60; or &#x3C; for <)
  • HTML5 supports many named entities for common characters
  • All Unicode characters can be represented using numeric entities
  • Encoders and decoders help convert between plain text and HTML entity formats

Common HTML Entities

Some of the most commonly used HTML entities include:

  • &lt; = < (less than)
  • &gt; = > (greater than)
  • &amp; = & (ampersand)
  • &quot; = " (quotation mark)
  • &apos; = ' (apostrophe)
  • &nbsp; = non-breaking space
  • &copy; = © (copyright)
  • &reg; = ® (registered trademark)

Security Considerations

Proper use of HTML entities is important for web security. By encoding special characters, you can prevent certain types of cross-site scripting (XSS) attacks. Always encode dynamic content that might include user-supplied data to ensure it's rendered safely in HTML.

Examples

Plain TextHTML Entities
<div>&lt;div&gt;
AT&TAT&amp;T
5 > 35 &gt; 3