Skip to main content

Web Tools

HTML Entity Encoder / Decoder

Convert text to and from HTML entities directly in your browser.

HTML Entity Encoder / Decoder tool

Loading tool…

Jump to a section

About This Tool

Use this HTML entity encoder and decoder when you need text to display literally inside HTML, or when copied content contains entities such as &, <, ©, or 💡 that you want to read normally. It is useful for documentation snippets, CMS copy, template examples, code samples, and debugging text that has been escaped one time too many.

How To Use It

  1. Choose Encode to escape HTML-sensitive characters, or Decode to turn entities back into readable text.
  2. Use the non-ASCII encode option when you also want characters such as symbols or accented letters represented as numeric entities.
  3. Paste or type the text to convert.
  4. Check the entity count and conversion status to confirm whether the output changed.
  5. Copy the result or use it as the next input to reverse-check the conversion.

Examples

Escape HTML markup

<strong>Hanakash</strong> becomes &lt;strong&gt;Hanakash&lt;/strong&gt; so it can be displayed as text.

Decode copied entities

Tom &amp; Jerry or &#169; decodes back to readable characters.

Encode non-ASCII text

With the non-ASCII option, Cafe © 💡 becomes Cafe &#169; &#128161;, while ordinary ASCII text remains readable.

Useful Notes

Handled entities

The decoder supports common named entities such as amp, lt, gt, quot, apos, and nbsp, plus decimal and hexadecimal numeric references. Unknown named entities are left unchanged instead of guessed.

What gets escaped

Encode mode replaces &, <, >, double quotes, single quotes, and non-breaking spaces. The optional non-ASCII mode also converts characters above ASCII into decimal numeric references.

HTML escaping context

Escaped text is meant for displaying literal content in HTML text or simple attribute values. It does not validate a whole HTML document, rewrite URLs, or make unsafe markup safe to execute.

Local processing

The conversion runs in your browser, which is useful when you are cleaning snippets, templates, documentation, or CMS text without needing to upload the content for conversion.

FAQ

Is this the same as URL encoding?

No. HTML entities make characters safe or readable in HTML content, while URL encoding prepares text for URLs and query strings.

Will this sanitize unsafe HTML?

No. It converts text characters and entities. It is not a full HTML sanitizer, DOM purifier, CSP replacement, or security filter for untrusted markup.

Does it decode numeric entities?

Yes. Decimal entities such as &#169; and hexadecimal entities such as &#x1F4A1; or &#X1F4A1; are decoded when they are valid Unicode code points. Both lowercase x and uppercase X hexadecimal prefixes are supported.

Why was an entity left unchanged?

Unknown named entities, malformed references, and invalid Unicode code points are preserved so the tool does not silently invent a character.

Should I encode HTML before putting it in a URL?

No. Use URL encoding for URLs and query strings. HTML entities are for HTML text and attribute contexts, not for percent-encoding a URL.