GT GetToolsFree
Free · No sign-up · Runs in your browser

HTML Entity Encoder / Decoder

Encode text into safe HTML entities, or decode HTML entities back into readable text — updates live as you type.

Ad space — 728×90 banner
Encoded

How to use the HTML Entity Encoder / Decoder

  1. Type or paste text into the box.
  2. Click "Encode" to turn special characters into HTML entities, or "Decode" to turn entities back into plain text.
  3. The result updates live as you keep typing in the chosen mode.
  4. Click "Copy result" to copy it.

How it works

Encoding replaces the five characters that have special meaning in HTML — < > & " ' — with their named entity equivalents, so the exact text can be embedded inside an HTML document without being misread as markup. Decoding runs in the opposite direction using a lookup table of common named entities (like &amp; and &copy;) plus support for numeric entities (&#169; or &#xA9;), matched with a plain regular expression rather than by handing the string to the browser's HTML parser — that distinction matters, because parsing untrusted text as HTML is exactly how script injection happens, and this tool deliberately never does that. For example, decoding &lt;img src=x onerror=alert(1)&gt; produces the literal text <img src=x onerror=alert(1)> as a string, which is then displayed as plain text — not as a real image tag, so nothing on the page executes.

Frequently asked questions

Is my text uploaded anywhere?

No — encoding and decoding happen entirely in your browser using JavaScript. Nothing is sent to a server.

Which characters get encoded?

The five characters that matter for HTML safety: < becomes &lt;, > becomes &gt;, & becomes &amp;, " becomes &quot;, and ' becomes &#39;. Unicode letters, emoji, and other characters are left untouched, since they display correctly without needing an entity.

Does this ever render the HTML I type in?

No, never. Your input is always treated as plain text data — this tool decodes entities using its own text-based logic, not by asking the browser to parse your input as HTML, so pasting something like a <script> tag never creates a real element, even when decoding.

What happens with a double-encoded entity, like &amp;lt;?

It decodes one level at a time, matching how browsers handle entities: &amp;lt; decodes to &lt; (not all the way to <). If you need to fully unwind a double-encoded string, click Decode a second time.