Skip to content
OddsockLocal
Local
Source text

Formatting

5 wordsRuns in this browser. Nothing is uploaded.

How to use

  1. Paste the text that contains entities.
  2. Leave Direction on decode.
  3. Read the characters. < is a character in the result, not a tag the page runs.
  4. Switch Direction only when you meant to encode.

What is HTML entity decoder?

HTML decode starts with Direction set to decode, so a pasted fragment is read as entities rather than escaped again. Tom &amp; Jerry &lt;script&gt; becomes Tom & Jerry <script>. Named entities and numeric entities both decode. The encoder page is the same library pointed the other way, and it is stricter than people expect: a period can come back as &period;.

Read more

Decoding does not make the text safe to drop into a page as HTML. The result of the example contains a raw <script>, which is the characters less-than, s, c, r, i, p, t, greater-than. If you insert that into a document as markup, a browser will treat it as a tag. The decode is for reading and for editing text, not for bypassing an escaper.

Unknown or broken entities are handled by the entity decoder’s usual rules. A bare ampersand may survive as an ampersand. If you meant to encode, switch Direction or use the encoder page, which starts on encode.

Use cases

  • A CMS export shows Tom &amp; Jerry and you want the ampersand back before the text goes into a plain-text field.
  • A title was stored as &lt;script&gt; and you need to see the brackets without rendering them.
  • You are checking a round trip: encode on the other page, decode here, and the sentence should match.
  • Numeric entities such as &#39; should become the character, not stay as digits.

Named entities for an ampersand and a tag

Direction decode. Tom &amp; Jerry &lt;script&gt;

Tom & Jerry <script>

Why use Oddsock

Decode is the default so a second visit does not escape the entities you just pasted and produce &amp;amp;.

Related tools

Using this tool

No. The result is text. Tom & Jerry <script> is six words and a bracketed word. Putting that string into innerHTML later would be a different, unsafe step.