Skip to content
OddsockLocal
Local
Source text

Formatting

5 wordsRuns in this browser. Nothing is uploaded.

How to use

  1. Paste the text to escape.
  2. Leave Direction on encode.
  3. Read the entities. Expect & and <, and also named forms such as ..
  4. Decode on the other page if you need the characters back.

What is HTML entity encoder?

The encoder turns characters into named HTML entities, and it does not stop at the five characters people usually escape. Odd socks in the dryer. becomes Odd socks in the dryer&period;. The period is &period;. Tom & Jerry <script> becomes Tom &amp; Jerry &lt;script&gt;, which is the part you wanted, sitting next to that more aggressive encoding.

Read more

That extra encoding surprises anyone who expected only & , < , > , quotes. A diff against a minimal escaper will show &period; and other named forms. Decode reverses them, so the round trip holds, but the encoded string is longer and noisier than a hand-written escaper. Direction starts on encode. The decoder page starts on decode.

Encoding is for putting text into HTML so the browser shows it. It is not encryption, and it is not a URL encoding. A space stays a space. %20 is the URL encoder’s job.

Use cases

  • A help page should show Tom & Jerry <script> as text, with the brackets visible.
  • You need to know that a period will be written &period; before you compare the output to a template that only escapes ampersands.
  • A round trip through the decoder should restore the sentence, including the period.
  • You are documenting the difference between this encoder and a URL encoder, which would turn the space into %20 and leave the period alone.

A sentence whose period becomes an entity

Direction encode. Odd socks in the dryer.

Odd socks in the dryer&period;

Why use Oddsock

The period is the surprise. If you only test with an ampersand, you will not see &period; until the copy is already in a template.

Related tools

Using this tool

This encoder emits named entities for a wide set of characters, not only & < > " '. Odd socks in the dryer. ends in &period;. The decoder turns that back into a period.