HTML Entity Encoder / Decoder

Encode and decode special HTML characters

← Back to ToolMitra
Result will appear here

About the HTML Entity Encoder Decoder

HTML entities let you show characters such as <, > and & on a web page without the browser treating them as code. This tool converts special characters into HTML entities and decodes entities back into normal text. It is useful for writing code examples, cleaning content and avoiding display problems in templates.

How to use the HTML Entity Encoder Decoder

  1. Paste your text or HTML into the box.
  2. Click Encode to turn special characters into entities, or Decode to reverse it.
  3. Copy the output into your page or editor.

Frequently asked questions

Why should I encode special characters?

Encoding stops the browser from reading characters like < and & as HTML, which keeps your content displaying correctly and helps prevent injection problems.

What is the difference between encoding and decoding?

Encoding turns characters into entity codes such as &amp;. Decoding turns those codes back into the original characters.

How the HTML Entity Encoder & Decoder works

HTML treats some characters as part of its syntax. If you want to display them as text on a page, you need to write them as entities. This tool replaces five characters: & becomes &amp;, < becomes &lt;, > becomes &gt;, a double quote becomes &quot; and a single quote becomes &#39;. Decode reverses the process.

Other characters, such as é or ©, are left as they are.

Worked examples

Input: <a href="x">Tom & Jerry</a>

Encoded output: &lt;a href=&quot;x&quot;&gt;Tom &amp; Jerry&lt;/a&gt;. Placed in an HTML page, this displays the original tag as visible text rather than being treated as a link.

Tips and common mistakes

More questions about the HTML Entity Encoder & Decoder

What is an HTML entity?

It is a code that begins with & and ends with ; that represents a character, for example &lt; for the less-than sign.

Why do I need to encode < and >?

Browsers use them to start and end tags. Without encoding, the browser would try to interpret your text as HTML.

Does it encode accented letters?

No. Only the five characters mentioned above are encoded.

Is it safe to paste HTML here?

Yes. The tool only changes the text and never runs it.

Related tools

← Back to all tools