Writing toolsHTML entity encoder and decoder

HTML entity encoder and decoder

Escape markup characters for display as text or decode named and numeric HTML character references.

Add or drop TXT, Markdown, CSV, TSV, LOG, DOCX, ODT, or PDF files.

Preview

What this tool is for

Prepare literal text for an HTML example. Escaping the angle brackets lets a browser show a tag on the page when you want readers to see the actual characters.

How to use it

Enter “A & B < C” with Direction set to Encode. Copy “A &amp; B &lt; C” from Preview into the text portion of your HTML. Choose Decode with that output as the input to get the original symbols back.

Worked example

Input

A & B < C

Result

A &amp; B &lt; C

Why do I see &amp;amp; in my output?

An already escaped ampersand gets escaped again. Start from the literal text if you need one layer of encoding. Decoding returns the characters, including any angle brackets, so review them before inserting the result as markup.