Formatting
HTML decode starts with Direction set to decode, so a pasted fragment is read as entities rather than escaped again. Tom & Jerry <script> 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 ..
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.
Direction decode. Tom & Jerry <script>
Tom & Jerry <script>
Decode is the default so a second visit does not escape the entities you just pasted and produce &amp;.
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.
The encoder uses named entities for more than the five classic characters. Decode turns . back into a period. Encode and decode are inverses of that library, not of a minimal escaper.
One decode pass turns &amp; into &. A second pass turns that into &. The page does not loop.
It starts on encode. This page starts on decode. Both can flip Direction.