Skip to content

Free HTML Entities Encoder & Decoder

Encode special characters to HTML entities (&, <, >, ") and decode HTML entities back to characters. Free, with no sign-up required — everything happens right in your browser, so nothing you enter is sent to a server.

💻 HTML Entities Encoder & Decoder

&amp;
&
&lt;
<
&gt;
>
&quot;
"
&apos;
'
&nbsp;
space
&copy;
©
&reg;
®

How the HTML Entities Encoder & Decoder Works

In Encode mode the tool replaces the five characters that have a special meaning in HTML with their entity names: the ampersand becomes &amp;, less-than becomes &lt;, greater-than becomes &gt;, the double quote becomes &quot; and the single quote becomes &#39;. In Decode mode it converts entities such as &copy; or &#8364; back into the characters they stand for, using your browser's own HTML parser so that all named and numeric entities are understood.

Encoding matters because a raw less-than sign in text can be mistaken for the start of a tag. Escaping user-provided text before inserting it into a page is a basic defence against cross-site scripting, but it is only one part of safe output, and escaping rules differ between HTML body text, attribute values, JavaScript and URLs. The tool only escapes the five special characters, so accented letters and symbols are left as they are, which is correct for pages served as UTF-8.

Practical Use Cases

  • Show code samples or HTML tags as visible text on a web page.
  • Escape text before pasting it into an HTML template or an attribute.
  • Decode a string full of entities, such as text copied from page source.
  • Check what a numeric entity like &#8364; represents.

Tips for Best Results

  • Escape text at the moment you insert it into a page, and use the escaping that matches the place: HTML text, attribute value, JavaScript string or URL.
  • Always quote attribute values. Encoding the quote characters protects an attribute from being broken by user-supplied text.
  • Decode only what you need. Decoding untrusted input and inserting it as HTML again can reintroduce the tags you escaped earlier.

Frequently Asked Questions

The ampersand, less-than, greater-than, double quote and single quote. These are the characters that can change the meaning of HTML.
So that characters such as < and & are shown as text instead of being treated as markup, which also helps prevent injection of unwanted tags.
Yes. Decoding uses the browser's HTML parser, so named entities and numeric entities are all converted.
No. Letters such as e with an accent are kept as they are, since UTF-8 pages can display them directly.
No. The conversion happens in your browser.