HTML Entity Encoder

Convert special characters into HTML entities for safe rendering in HTML documents.

Text → HTML Entities

HTML Entities → Text

Common HTML Entities

CharacterEntityNumericDescription
<&lt;&#60;Less than
>&gt;&#62;Greater than
&&amp;&#38;Ampersand
"&quot;&#34;Quotation mark
'&apos;&#39;Apostrophe
&nbsp;&#160;Non-breaking space
©&copy;&#169;Copyright
®&reg;&#174;Registered
&trade;&#8482;Trademark
&euro;&#8364;Euro
ä&auml;&#228;a umlaut
ö&ouml;&#246;o umlaut
ü&uuml;&#252;u umlaut

What are HTML Entities?

HTML entities are special character sequences that represent reserved or non-printable characters in HTML.

Format: &name; oder &#nummer;

Why does it matter?

  • Security: Prevents XSS attacks
  • Correct rendering: Shows < and > as text
  • Special characters: © ® ™ € etc.
  • Umlauts: ä ö ü without UTF-8

Tips

  • Always escape <>&
  • In attributes also escape "
  • UTF-8 makes entity umlauts unnecessary
  • Numeric entities are more universal

PHP Example

// Encode
htmlspecialchars($text);

// Decode
html_entity_decode($text);

Was this tool helpful?

'; encodeHTML(); });