HTML Entities Converter

Convert special characters to HTML entities for safe display on web pages. Encode and decode symbols, accents and reserved characters.

HTML Entities Converter

Mode:

🔤 What are HTML Entities?
HTML entities are codes that represent special characters in HTML. They are necessary to correctly display characters that have special meaning in HTML.

📖 Common examples:
• < represents <
• > represents >
• & represents &
• " represents "
• © represents ©
• á represents á

💡 Use: Essential when displaying HTML code on web pages or when working with special characters that can break HTML formatting.

What are HTML Entities?

HTML entities are special codes that represent characters that have special meaning in HTML or that are not available on the keyboard. They start with & and end with ; (named format) or use numeric codes.

Why Use Them?

Most Common Entities

< (less than) → &lt; or &#60;
> (greater than) → &gt; or &#62;
& (ampersand) → &amp; or &#38;
" (double quote) → &quot; or &#34;
' (single quote) → &apos; or &#39;
non-breaking space&nbsp; or &#160;
© (copyright) → &copy; or &#169;
® (registered) → &reg; or &#174;
(euro) → &euro; or &#8364;
(trademark) → &trade; or &#8482;

Portuguese Accents

á → &aacute;
à → &agrave;
â → &acirc;
ã → &atilde;
é → &eacute;
ê → &ecirc;
í → &iacute;
ó → &oacute;
ô → &ocirc;
õ → &otilde;
ú → &uacute;
ç → &ccedil;

Use Cases

Security Example (XSS)

⚠️ Malicious user input:

<script>alert('Hacked!');</script>

✅ After conversion to entities (safe):

&lt;script&gt;alert('Hacked!');&lt;/script&gt;

The code is displayed as text, not executed!

Entity Formats

Named

More readable: &copy;, &euro;

Not all characters have names

Numeric

Universal: &#169;, &#8364;

Work for any Unicode character

UTF-8 vs Entities

💡 Modern Practice: With UTF-8 as the default charset, accents and common symbols can be used directly. Use entities mainly for:
• Reserved HTML characters (< > &)
• XSS Prevention
• Mathematical/special symbols

Useful Symbols

&rarr;
&larr;
&uarr;
&darr;
&hearts;
&spades;
&clubs;
&diams;
&bull;
&hellip;
&mdash;
&ndash;

🔒 Security: Always escape user output in web applications to prevent XSS attacks. Use functions specific to your language/framework.