Free Tool

HTML Entity Encoder & Decoder

Encode special characters to HTML entities and decode them back to plain text. Supports named entities (&, <, ©…) and numeric entities (decimal & hex). Free, no sign-up.

HTML Entity Encoder

HTML Entity Decoder

Common HTML Entities

&amp;&
&lt;<
&gt;>
&quot;"
&#39;'
&nbsp;
&copy;©
&reg;®
&trade;
&mdash;
&euro;
&hellip;

What are HTML entities?

Certain characters have special meaning in HTML: < starts a tag, > ends one, & starts an entity, and " delimits attributes. To display these literally, they must be encoded as &lt;, &gt;, &amp;, and &quot;.

When encoding is required

Encode when inserting user-supplied text into HTML to prevent XSS. Also encode characters outside the ASCII range if your document charset is not UTF-8.

Named vs numeric entities

Named entities like &amp; are readable. Numeric entities (&#38; or &#x26;) work for any Unicode character that lacks a named form.

How to use

  1. Paste your text into the input area.
  2. Click "Encode" to convert reserved characters to HTML entities, or "Decode" to convert entities back to plain text.
  3. Copy the result with the "Copy" button.

Frequently Asked Questions

What are HTML entities?
HTML entities are special codes used to represent characters that have meaning in HTML syntax or that are not easily typed. For example, &amp; represents &, &lt; represents <, and &gt; represents >. They prevent browsers from misinterpreting special characters as HTML tags.
When do I need to encode HTML entities?
You need to encode HTML entities when inserting user-supplied text into HTML to prevent XSS (cross-site scripting) attacks. Characters like <, >, &, and " must be encoded so browsers treat them as text, not HTML markup.
What is the difference between &amp; and &#38;?
&amp; is a named entity reference for the ampersand character. &#38; is the same character expressed as a decimal numeric entity. &#x26; is the hexadecimal form. All three produce the same & character.
What is &nbsp;?
&nbsp; is the HTML entity for a non-breaking space — a space character that prevents line breaks at that position. Unlike a regular space, browsers will not collapse multiple &nbsp; entities into one.