TuttiTools
&;

HTML Entity Encoder / Decoder

Encode and decode HTML entities

What are HTML Entities?

HTML uses certain characters as part of its syntax — angle brackets (< and >), ampersands (&), and quotes are all special in HTML. If you want these characters to appear as visible text on a web page rather than being interpreted as HTML code, they need to be encoded as HTML entities.

For example, < becomes &lt;, > becomes &gt;, and & becomes &amp;. There are also entities for characters that aren’t on a standard keyboard, like copyright symbols (&copy;), em dashes (&mdash;), and non-breaking spaces (&nbsp;).

What Does This Tool Do?

This tool encodes text into HTML entities (replacing special characters with their entity equivalents) and decodes HTML entities back to plain text. It handles both named entities and numeric character references.

How to Use This Tool

  1. Choose Encode or Decode mode.
  2. Paste or type your text in the input area.
  3. The result appears immediately.
  4. Use the copy button to grab the output.

Common Use Cases

Entity Reference Table

The entities you’ll actually use, grouped by purpose:

CharacterNamedNumericNotes
<&lt;&#60;must be escaped in content
>&gt;&#62;
&&amp;&#38;must be escaped everywhere
"&quot;&#34;required inside double-quoted attributes
'&apos;&#39;&apos; is not valid in old HTML4 — prefer &#39;
non-breaking space&nbsp;&#160;keeps words together across line breaks
©&copy;&#169;
®&reg;&#174;
&trade;&#8482;
— (em dash)&mdash;&#8212;
– (en dash)&ndash;&#8211;
&hellip;&#8230;
&euro;&#8364;
&rarr;&#8594;
&check;&#10003;

Do You Still Need Entities in 2026?

Less than you’d think. Modern pages declare <meta charset="utf-8">, so you can type ©, , or directly into your HTML — no entity required. Only three cases genuinely require entities today:

  1. The syntax characters <, >, & (and quotes inside attributes) — these always need escaping because they mean something to the parser.
  2. Invisible or ambiguous characters&nbsp;, zero-width spaces, soft hyphens — where a literal character would be indistinguishable from a regular space in your editor.
  3. Content that passes through encoding-hostile systems — old email clients, misconfigured databases, or templates saved in Latin-1.

If you’re escaping user input to prevent XSS, entity-encode < > & " ' at minimum — that neutralizes tag injection and attribute breakout.

Frequently Asked Questions

What's the difference between named and numeric entities?

Named entities like &lt; are human-readable. Numeric entities like &#60; or &#x3C; (hex) represent the same character by its Unicode code point. Both are valid HTML.

Does this protect against XSS attacks?

Encoding user input as HTML entities is an important step in preventing XSS. However, proper security requires a complete approach — use server-side sanitization libraries, not just this tool.

Is my data private?

Yes. All encoding and decoding runs locally in your browser.

Why do I see &amp;amp; in my content?

That’s double encoding — the & of an already-encoded &amp; was encoded again. It usually means two layers of your stack both escape output. Decode here repeatedly until the text stops changing to see the original, then fix the duplicate escaping step.

Should I encode entities in JSON or JavaScript strings?

No — HTML entities are only meaningful inside HTML. JSON uses backslash escapes (\n, é), and JavaScript strings likewise. Encoding &lt; into a JSON value just puts the literal five characters &lt; in your data.

Related Tools