HTML Entity Encoder and Decoder Online

Encode special characters to HTML entities or decode them back.

Free online HTML entity encoder and decoder

Use this HTML entity converter to encode special characters into HTML entities and decode them back. It is useful for escaping user input, displaying code on a page, and preventing HTML injection.

Input: <div>Hello</div>
Output: &lt;div&gt;Hello&lt;/div&gt;

What are HTML entities?

HTML entities are special codes that represent reserved characters. For example, &lt; displays the less-than sign, &gt; displays the greater-than sign, and &amp; displays an ampersand.

Common HTML entity uses

  • Display code snippets safely on a web page.
  • Escape user-generated content before it is rendered.
  • Convert between named entities and their raw characters.

FAQ

What is an HTML entity?

An HTML entity is a code that represents a reserved or special character in HTML, such as &lt; for the less-than sign.

Why encode HTML entities?

Encoding HTML entities prevents browsers from treating characters like < and > as markup, which helps display code and avoid HTML injection.

What is the difference between named and numeric entities?

Named entities use a word like &lt;, while numeric entities use a number like &#60;. Both represent the same character.

Is this HTML entity tool free and private?

Yes. It is free and runs locally in your browser, so your text is not sent to a server.