AXS TXT

HTML Encode / Decode

Escape text into HTML entities or decode HTML entities back to text.

To show characters like <, > and & as literal text on a web page rather than have the browser interpret them as code, they must be escaped into HTML entities. HTML Encode / Decode converts text to entities and back, in your browser.

How to use html encode / decode

  1. 1. Paste text or HTML-encoded content.
  2. 2. Choose encode (to entities) or decode (to text).
  3. 3. Copy the result.

When to use HTML Encode / Decode

Display code on a page

Encode a snippet so tags show as text instead of being rendered.

Prevent broken markup

Escape special characters so they don't break your HTML.

Decode entities

Turn &amp; and friends back into their plain characters.

Decoding handles every entity

Decoding understands all named entities (&eacute;, &nbsp;, &copy;) and numeric ones in decimal or hex (&#8364; and &#x20AC; are both €). Encoding text that's already encoded encodes it again — &amp; becomes &amp;amp; — so if you see that in a page, it was escaped twice.

Frequently asked questions

Which characters get encoded?

Exactly five: & < > " and ', which become &amp; &lt; &gt; &quot; and &#39;. Accented letters and emoji are left as they are — on any page served as UTF-8 they display correctly without entities.

Does this make my page safe from XSS?

Escaping output is one important defence, but security depends on your whole setup; don't rely on this tool as your only safeguard.

Is my input private?

Yes — it's processed in your browser.

Your text is processed entirely in your browser and never uploaded — read more on the security page. Looking for more? Browse our full set of text tools or read guides on the blog.