HTML Encode & Decode

Paste markup or entity-escaped text into Input, then Encode to turn & < > and quotes into safe entities, or Decode to restore the original characters. The result appears below the buttons.

Updated 2026-08-03 · developer

About this tool

Encode replaces ampersands, angle brackets, and double quotes with &amp; &lt; &gt; and &quot;. Decode reverses those four entities in a safe order so nested ampersands do not break. Both actions run on the textarea text and write into the result area—no file upload.

How to use

  1. Paste into Input: Put the HTML fragment or entity string into the Input textarea.
  2. Encode special characters: Click Encode to convert &, <, >, and " into HTML entities in the result.
  3. Decode entities: Click Decode to turn &lt; &gt; &quot; and &amp; back into live characters.
  4. Copy the result: Select the text in the result area and paste it into your editor or template.

Common use cases

Tips

FAQ

Which characters does Encode change?

It escapes ampersand, less-than, greater-than, and double quote. Other characters stay as typed.

Why decode &amp; after the other entities?

Decoding &amp; last prevents turning &amp;lt; into a broken intermediate string before &lt; is handled.

Does this tool send my HTML to a server?

No. Encode and Decode transform the Input value in the page.

Can I encode an empty Input?

Yes. An empty string encodes and decodes to an empty result.

Related keywords

Related tools