Dev Tool

HTML Entity Encoder / Decoder

Encode special characters to HTML entities or decode HTML entities back to text. Prevent XSS vulnerabilities and display HTML code safely. Includes a reference chart of common entities.

html entity encoderhtml entity decoderhtml encode special charactershtml escape toolhtml entities onlineencode html freehtml character encodingxss prevention tool

🛠️ HTML Entity Encoder / Decoder

Result appears here.

Common HTML Entities

&amp; → & &lt; → < &gt; → > &quot; → " &apos; → ' &copy; → © &reg; → ® &trade; → ™ &nbsp; → (space) &euro; → €

How to Use the HTML Entity Encoder / Decoder

  1. Paste your HTML or text containing special characters into the input box above.

  2. Click Encode Entities to convert special characters like <, >, &, and " into their HTML entity equivalents.

  3. Or click Decode Entities to convert HTML entities back to their original characters.

  4. Click Copy to copy the result to your clipboard.

What Are HTML Entities?

HTML entities are special character codes used to represent characters that have special meaning in HTML, or characters that can't easily be typed on a keyboard. They start with an ampersand (&) and end with a semicolon (;). For example, &lt; represents the less-than sign (<).

Why Encode HTML Entities?

When you include user-generated content or code snippets in an HTML page, characters like < and > would be interpreted as HTML tags. Encoding them prevents the browser from treating them as markup, which is critical for preventing Cross-Site Scripting (XSS) vulnerabilities and for displaying source code correctly.

Most Important HTML Entities