Free HTML Encoder: Escape Characters for HTML

Free tool ยท nothing is uploaded

Free HTML encoder

Paste text that should appear as text, not as markup. This page encodes the five characters that change HTML, and it decodes those entities back. The text stays in your browser.

A less-than sign converted to the HTML entity ampersand l t semicolon.
The picture is the idea. The box below is the encoder.

Encoded

Decoded

The two lines update as you type. They are not sent anywhere.

How the characters are escaped

  1. & becomes &. This happens first, so the entities added below stay readable.
  2. < becomes &lt;. > becomes &gt;.
  3. A double quote becomes &quot;. An apostrophe becomes &#39;.
  4. Decoding reads amp, lt, gt, quot, apos, and numeric references such as &#60; or &#x3C;. Each entity is read once. &amp;lt; becomes &lt;, not a less-than sign.
  5. An entity this page does not know is left as typed.

Use this when a title or a code sample must show a tag instead of being read as HTML. It does not edit a live page. For characters that must be safe inside a URL, use the URL encoder. Percent-encoding and HTML entities are different.

Questions about this encoder

What does this HTML encoder change?

It replaces five characters with entities: & becomes &amp;, < becomes &lt;, > becomes &gt;, a double quote becomes &quot;, and an apostrophe becomes &#39;. Ampersand is replaced first so the new entities are not encoded again.

What does decoding turn back into characters?

The named entities amp, lt, gt, quot, and apos, the numeric entity &#39;, and other decimal or hexadecimal character references such as &#60; and &#x3C;. Each entity is read once, so &amp;lt; becomes &lt; and not a less-than sign.

Does this remove a script from a live page?

No. It only rewrites the text in this box. It does not edit a published page, and it does not decide whether a page is safe.

Does this tool upload what I paste?

No. The text stays in the browser. Blogoose does not receive it.