Calculator Need
Categories

HTML Encoder / Decoder

Escape HTML entities for display, or decode them back.

What gets escaped

CharacterEntity
&&
<&lt;
>&gt;
"&quot;
'&#39;

Runs entirely in your browser. Nothing you paste or upload leaves your device.

How to use the HTML encoder / decoder

  1. Paste HTML or text into the Input box, or press “Sample”.
  2. Press “Encode” to escape it, or “Decode” to turn entities back.
  3. Copy or download the result.

HTML encoder / decoder example

The text <b>Tom & "Jerry"</b> encodes to &lt;b&gt;Tom &amp; &quot;Jerry&quot;&lt;/b&gt;, which a browser shows as text instead of bold markup.

When to encode

  • Showing user-submitted text on a web page (prevents HTML injection).
  • Putting code samples into a blog post.
  • Writing attribute values that contain quotes.

HTML encoder / decoder: common questions

What does encoding do?
It turns characters such as <, > and & into HTML entities (<, >, &amp;) so the text displays as text instead of being read as HTML.
When would I use this?
When showing code on a web page, or when putting user text into HTML safely.
Is my input uploaded?
No. Encoding and decoding happen in your browser.
Does encoding protect against all XSS?
It is the main defence for HTML text, but content inside scripts, URLs and CSS needs its own escaping rules.