HTML Entity Encoder and Decoder

Encodes special characters as HTML entities, or decodes entities back into ordinary characters. It is useful for showing an HTML tag as text on a web page, or for making sense of text full of codes such as & and <. The result is always shown as plain text.

Up to 1 MiB.

Options

How to use the HTML Entity Encoder and Decoder

  1. Choose Encode or Decode, then type or paste your text.
  2. When encoding, choose which characters to convert and the entity style.

Rules applied

  • Decoding understands the HTML 4 named entities, ' and decimal and hexadecimal references.
  • Encoding always converts & < > " '; the apostrophe uses &#39; because older HTML has no name for it.

Safety and limitations

  • The result is shown as plain text and never rendered as HTML.
  • Newer HTML5-only names (such as &NewLine;) are left unchanged when decoding.

Worked examples

Escape HTML special characters

Input

<a href="x">Tom & Jerry's</a>

Result

&lt;a href=&quot;x&quot;&gt;Tom &amp; Jerry&#39;s&lt;/a&gt;
Decode entities

Input

Caf&eacute; &amp; cr&#232;me &#x1F600; &copy; 2026

Result

Café & crème 😀 © 2026

Practical uses

  • Show code examples on a web page

    A blogger wants to display an HTML tag as text in a tutorial. They choose Encode and paste the tag. The special characters are converted, so the browser shows the tag instead of treating it as markup.

  • Read text copied from page source

    An editor copies text from page source that is full of codes such as &eacute; and &amp;. They choose Decode and paste it in. The codes turn back into readable letters and symbols, so the text can be read and edited normally.

Privacy: this tool runs entirely in your browser. Your text is not uploaded, logged or saved, and it is never sent to analytics. Maximum input: 1 MiB.