Internative Logo

HTML Decode and Encode Online

HTML Entity Decoder and Special Character Encoder

Decode HTML entities back to readable text, or encode special characters into entities. Handles named and numeric entities in both directions.

How to use the HTML encoder and decoder

  1. 1

    Paste your text

    Enter text or HTML entities in the text area. Use Encode to represent special characters as entities, or Decode to turn entities back into characters.

  2. 2

    Choose non-ASCII handling

    Leave the checkbox off to preserve accented letters, Turkish letters, symbols and emoji. Enable it to encode characters above U+007E as decimal numeric entities, for example é becomes é.

  3. 3

    Encode or decode

    Press Encode: 5 < 7 && 7 > 3 becomes 5 &lt; 7 &amp;&amp; 7 &gt; 3. Press Decode to reverse the conversion.

  4. 4

    Repeat or clear

    Decode processes one level at a time: &amp;lt; becomes &lt;, and another Decode turns it into <. Use Clear to empty the text area.

Explore More Tools

HTML Encode and Decode Examples

Compare plain text with its encoded form, then use the entity reference to identify common characters. The café example uses the optional non-ASCII checkbox.

Common HTML entities

CharacterNamed entityNumeric entityMeaning
&&amp;&#38;Ampersand
<&lt;&#60;Less-than sign
>&gt;&#62;Greater-than sign
"&quot;&#34;Double quote
'&#39;&#39;Apostrophe (&apos; is HTML5 only)
(non-breaking space)&nbsp;&#160;Space that does not wrap
©&copy;&#169;Copyright sign
€&euro;&#8364;Euro sign
é&eacute;&#233;Latin small e with acute

Encode and decode, before and after

Plain textEncoded
<a href="/pricing">Tom & Jerry</a>&lt;a href=&quot;/pricing&quot;&gt;Tom &amp; Jerry&lt;/a&gt;
5 < 7 && 7 > 35 &lt; 7 &amp;&amp; 7 &gt; 3
It's "quoted"It&#39;s &quot;quoted&quot;
café (checkbox on)caf&#233;
&lt;b&gt; (encoded twice)&amp;lt;b&amp;gt;

Escape a string in JavaScript JavaScript

const escapeHtml = (s) => s.replace(/[&<>"']/g, (c) => ({ "&": "&amp;", "<": "&lt;", ">": "&gt;", '"': "&quot;", "'": "&#39;" })[c]);

Encode and decode in Python Python

import html
html.escape("<a href=\"/pricing\">Tom & Jerry</a>")  # '&lt;a href=&quot;/pricing&quot;&gt;Tom &amp; Jerry&lt;/a&gt;'
html.unescape("&lt;p&gt;caf&eacute;&lt;/p&gt;")  # '<p>café</p>'

Frequently asked questions

What does HTML encode do to special characters?

HTML encoding replaces special characters with entities so they can appear as text in HTML. This encoder changes & to &amp;, < to &lt;, > to &gt;, " to &quot;, and ' to &#39;. These escapes suit HTML text and quoted attribute values; JavaScript inside a script block, URLs and CSS require different handling.

How do I decode HTML entities online?

Paste your text into the text area and press Decode to convert HTML entities back to characters. The HTML entity decoder uses the browser's parser for HTML5 named references, decimal references and hexadecimal references. For example, &copy;, &#169; and &#xA9; represent ©, while &nbsp; represents a non-breaking space, U+00A0.

Why does my encoded text contain &amp;amp;?

The sequence &amp;amp; appears when &amp; is encoded again, which is called double encoding. Rendered as HTML, it displays the literal text &amp;. Decode removes one level per click: &amp;lt; becomes &lt;, and a second click produces <.

Do I need HTML entities for accented letters or emoji?

UTF-8 HTML documents do not need entities for accented letters, Turkish letters or emoji. The checkbox is off by default, so these characters stay unchanged. Enable it when needed for old encodings, email templates or systems that mishandle non-ASCII text: é becomes &#233;, € becomes &#8364;, and 😀 becomes &#128512;.

Is HTML decrypt the same as decoding or sanitizing?

“HTML decrypt” usually means decoding entities; it is neither decryption nor sanitization. Entities are reversible text representations with no encryption key. This tool does not remove tags or strip scripts, and decoding untrusted HTML does not make it safe to insert into a page.

Is my text sent to a server?

No, all encoding and decoding happens in your browser, and your text is not sent anywhere. Decoding only reads the result as text; it does not execute scripts or load anything.

Use the encoding or format tool that matches your next step.

Built by Internative

Crafted by our software and AI engineering team

Every free tool here is a byproduct of the custom software, SaaS platforms and AI products we ship for our enterprise clients. Need a production-grade version, an API, or a full engineering team behind the next build? Let's talk.

Related services from Internative

The commercial engineering services closest to this tool.