HTML Entity Encoder & Decoder

Encode text into HTML entities and decode entities back to text. Handles named (©), decimal (©), and hex (©) entities.

HTML Entity Encoder & Decoder

Encode text into HTML entities and decode entities back to text. Handles named (©), decimal (©), and hex (©) entities.

Paste text with <, >, &, or quotes and get safe HTML entities back — or paste entities and get readable text. The encoder covers the five markup-significant characters plus common typographic symbols (©, €, —, curly quotes), and the decoder understands named, decimal, and hexadecimal entities.

Encodes <, >, &, quotes and common symbols to named entities (apostrophe becomes &#x27;).

How to use this calculator

  1. Type or paste your text into the input box.
  2. Click Encode to convert special characters to entities, or Decode to reverse entities back to text.
  3. Use the Copy button to grab the result.
  4. Paste the output into your HTML page, CMS, or code sample.

Worked example

Encoding Tom & "Jerry" <cartoon> produces Tom &amp; &quot;Jerry&quot; &lt;cartoon&gt; — verified by running the encoder. The browser now renders the literal characters instead of treating <cartoon> as an HTML tag.

Frequently Asked Questions

When do I need HTML entities?

Whenever you display reserved characters like <, >, or & in HTML without the browser interpreting them as markup. Typical cases: showing code samples on a page, rendering user-generated content safely, or pasting text into a CMS. Entities guarantee the character renders as literal text, never as an HTML tag.

What's the difference between named, decimal, and hex entities?

Named entities like &copy; are readable mnemonics for common symbols. Decimal (&#169;) and hex (&#xA9;) entities reference the character's Unicode code point directly and can represent any character, including emoji. All three render identically in the browser — pick whichever is clearest for your situation.

Why does encoding &lt; give &amp;lt; instead of <?

Because the encoder replaces each source character exactly once. Your input &lt; is four literal characters (&, l, t, ;), and only the & is special — so it becomes &amp;lt;, which displays as the literal text "&lt;". This is the correct, safe behavior: output always renders as the text you typed.

Which characters does the encoder handle?

The five markup-significant characters (& < > " ') plus common typographic symbols: © ® € £ ¥ ¢ § ¶ • – — ‘ ’ “ ” … and the non-breaking space. The apostrophe encodes as the numeric entity &#x27;. Everything else passes through unchanged.

Do I still need entities now that everything is UTF-8?

For <, >, and & — always. Those characters are structural to HTML regardless of charset, and leaving them raw breaks pages or opens XSS holes. For accented characters and symbols, UTF-8 pages can include them directly, but entities remain the safe choice when you're unsure of the page encoding or injecting text into attributes and scripts.