99digest is in early access — tools are free while we grow.
Guide

How to Encode and Decode HTML Entities

To encode HTML entities, paste your text into this HTML entity encoder and choose Encode; characters such as <, > and & become &lt;, &gt; and &amp; so they display as text instead of being read as markup. Choose Decode to convert entities back to characters.

Follow along with the free HTML Entity Encoder/Decoder, which runs in your browser, or browse more tools in this category.

How to use the HTML Entity Encoder/Decoder

  1. Paste your text or the entity-encoded string.
  2. Choose Encode or Decode.
  3. Review the output.
  4. Copy it into your HTML or CMS.

Worked example

Encoding <b>Tom & Jerry</b> gives &lt;b&gt;Tom &amp; Jerry&lt;/b&gt;, which a browser shows as the literal text instead of bold formatting.

Tips and common mistakes

  • Encode user-provided text before inserting it into a page to avoid it being read as markup.
  • Ampersands in URLs inside HTML attributes should be written as &amp;.
  • Decode to read text copied from HTML source.

Frequently asked questions

What is an HTML entity?

A code such as &amp; or &lt; that represents a character reserved by HTML.

Do I need to encode accented letters?

Not if your page is UTF-8, though the tool can encode them if you want.

Is my text sent anywhere?

No. Conversion is local.

Try the HTML Entity Encoder/Decoder Free, instant, and runs in your browser.