Developer Tools

HTML Encoder / Decoder

Encode text to HTML entities or decode HTML entities back to plain text — instantly and privately.

Updated June 2026

0 characters · 0 lines

How to use the HTML Encoder / Decoder

  1. 1

    Paste your text or HTML

    Drop plain text into the box to encode it, or encoded markup containing entities to decode it.

  2. 2

    Pick Encode or Decode

    Use the Encode tab to escape characters into HTML entities, or the Decode tab to convert entities back to text.

  3. 3

    Copy the result

    Your converted output appears instantly. Hit Copy result to grab it. Nothing is saved.

About this tool

HTML encoding replaces characters that have special meaning in markup — the ampersand (&), less-than (<), greater-than (>), double quote ("), and apostrophe (') — with their HTML entity equivalents such as &amp;, &lt;, &gt;, &quot;, and &#39;. Encoding these characters is essential whenever you display user-supplied text inside a page, because it prevents the browser from interpreting the input as markup and stops a whole class of cross-site scripting (XSS) bugs.

This tool works both ways. Choose Encode to escape raw text into safe HTML entities, or Decode to turn entities — including named ones like &nbsp;, numeric references like &#169;, and hex references like &#x1F600; — back into the original characters. The decoder understands every form a browser does, so content copied out of HTML round-trips cleanly back to plain text.

Front-end developers, technical writers, and anyone pasting code samples into a CMS reach for an HTML encoder constantly. Because this one runs entirely client-side, your text is never sent to a server, logged, or stored — making it safe for snippets, tokens embedded in attributes, and any content you would rather keep private.

Examples

Input

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

Output

&lt;a href=&quot;x&quot;&gt;Tom &amp; Jerry&lt;/a&gt;

Encode: < > " and & all become entities. The ampersand is escaped first so entities are never double-encoded.

Input

5 &lt; 10 &amp;&amp; 10 &gt; 5

Output

5 < 10 && 10 > 5

Decode: named entities &lt; &gt; and &amp; are converted back to their original characters.

Input

&nbsp;2026 &#169; &#x1F600;

Output

2026 © 😀

Decode also resolves the &nbsp; named entity plus decimal (&#169;) and hexadecimal (&#x1F600;) numeric character references.

Common uses

  • Front-end developers escaping user-generated content before rendering it in HTML to prevent cross-site scripting (XSS) attacks.
  • Technical writers and bloggers pasting code samples into a CMS or markdown file and needing to show literal < > & characters instead of having them parsed as tags.
  • Support engineers decoding HTML entities copied out of a rendered page or email back into readable plain text.
  • Developers embedding text inside an HTML attribute (such as a title or alt value) who must escape quotes so the markup stays valid.
  • QA and security testers crafting or inspecting encoded payloads while reproducing and verifying entity-encoding bugs.
  • Anyone migrating content between systems and round-tripping text through encode and decode to confirm it survives unchanged.

Frequently asked questions

Is this HTML encoder free?+

Yes. It is completely free with no sign-up, no limits, and no watermarks.

Is my data uploaded or stored anywhere?+

No. Both encoding and decoding happen locally in your browser using JavaScript. Your text never leaves your device, which makes it safe for sensitive snippets.

Which characters does it escape?+

Encoding escapes the five HTML-significant characters: & becomes &amp;, < becomes &lt;, > becomes &gt;, " becomes &quot;, and ' becomes &#39;. The ampersand is escaped first so entities are never double-encoded.

Why does HTML encoding matter for security?+

Displaying unescaped user input lets attackers inject markup and scripts, causing cross-site scripting (XSS). Encoding special characters into entities makes the browser render them as text instead of executing them.

What entities can the decoder handle?+

It decodes the named entities amp, lt, gt, quot, apos, and nbsp, plus any decimal (&#169;) or hexadecimal (&#x1F600;) numeric character reference back to its original character.

Embed this tool

Free to use on your own site — it stays fast and private for your visitors.

Paste this where you want the tool to appear:

<iframe src="https://hypercho.com/embed/html-encoder" title="HTML Encoder / Decoder by Hypercho" width="100%" height="560" style="border:1px solid #d8cec3;border-radius:16px;max-width:720px" loading="lazy"></iframe>
<p style="font:13px sans-serif"><a href="https://hypercho.com/tools/html-encoder" target="_blank" rel="noopener">HTML Encoder / Decoder</a> by <a href="https://hypercho.com" target="_blank" rel="noopener">Hypercho</a></p>