0

Decoded

HTML Escape

Encoded

HTML Escape
Target
Named Character References
Numeric Reference Notation

About HTML escape

HTML escape converts characters that have special meaning in HTML into character references, so that a string can be displayed safely as HTML text. For example, < and >, which may be interpreted as tags, are written as &lt; and &gt;.

Escaping HTML prevents the input text from being interpreted as HTML tags or attributes and lets it appear on the screen as text.

For example, escaping “<p>Hello, world!</p>” produces the following.

&lt;p&gt;Hello, world!&lt;/p&gt;
CharacterAfter HTML escapeDescription
<&lt;May be interpreted as the start of an HTML tag.
>&gt;May be interpreted as the end of an HTML tag.
&&amp;May be interpreted as the start of a character reference.
"&quot;Has special meaning when an attribute value is enclosed in double quotes.
'&apos;Has special meaning when an attribute value is enclosed in single quotes.

HTML escape options

DenCode lets you choose the target characters, how named character references are used, and the numeric reference notation.

Target
OptionDescriptionExample for “A < 😀”
BasicConverts the five characters <, >, &, ", and '.A &lt; 😀
Basic + Non-ASCIIConverts the five basic characters and non-ASCII characters.A &lt; &#128512;
Non-AlphanumericConverts characters other than ASCII letters and digits.A&#32;&lt;&#32;&#128512;
AllConverts all characters.&#65;&#32;&lt;&#32;&#128512;

For normal HTML display, “Basic” is commonly used because it converts only the necessary characters. Use “All” when you want to inspect a string as HTML character references or represent every character explicitly as a reference.

Named Character References
OptionDescriptionExample
HTML5Uses named character references defined by HTML5.&copy;
HTML4Uses named character references defined by HTML4.&copy;
XHTMLUses the five references &lt;, &gt;, &amp;, &quot;, and &apos;.&apos;
NoneDoes not use named character references; only numeric references are used.&#169;
Numeric Reference Notation
OptionDescriptionExample
DecimalUses decimal numeric references.&#169;
Hex lower-caseUses hexadecimal numeric references with lower-case digits.&#xa9;
Hex upper-caseUses hexadecimal numeric references with upper-case digits.&#xA9;