Skip to content

Use this result well

Inputs that matter
Text, the HTML Entities Encode/Decode choice and, for decoding, the Text, Attribute value or Require semicolons context.
Output to expect
Escaped &, <, > and quote characters, or text decoded from HTML named and numeric character references.
How it works
Encoding replaces five characters once. Decoding follows the selected character-reference rules for one layer; a chain can choose a context for each HTML decoding step.
  • Text and attribute rules can differ when a semicolon is missing. Require semicolons keeps incomplete references unchanged; it does not validate a whole document.
  • Copy returns only the output text. Review it before inserting it into another context; converting references does not sanitize a page or execute its markup.
  • Text input is limited to 2,000,000 UTF-16 units and each result to 20,000,000. Large conversions can be cancelled or retried.
  • Chains allow up to 12 steps. Intermediate previews are shortened; Copy retains the complete final result.
Was this tool helpful?

Reference & details

How it works

Five-character replacement

The encoder replaces each matching character once in the original input. Characters introduced by that replacement are not encoded again during the same operation.

Immediate text preview

Input changes update the output. The Single Transform view performs the selected operation; Chain Transform applies the configured steps in their displayed order.

Use the destination context

Review where the result will be inserted. Escaping HTML text does not check an entire page or replace the rules for URLs, scripts, styles and other formats.

Updated: September 2026

Example Scenarios

Encode a short tag example for display as text.

Input: <b>A&B</b>

&lt;b&gt;A&amp;B&lt;/b&gt;

Compare the references used for a double quote and an apostrophe.

Input: "It's"

&quot;It&#39;s&quot;

Check how an already encoded reference changes before pasting it into documentation.

Input: &lt;

&amp;lt;

FAQ

The encoder replaces & with &amp;, < with &lt;, > with &gt;, double quote with &quot;, and apostrophe with &#39;. Other characters, including accented letters and emoji, stay as entered.

An existing ampersand is encoded again. For example, &lt; becomes &amp;lt;. Start from the original text when you need exactly one encoding layer.

No. This operation escapes five text characters. It does not validate a document, remove unsafe URLs, or prepare data for JavaScript, CSS or an unquoted attribute.

Select Decode in the HTML Entities view or open HTML Entity Decoder, then choose Text, Attribute value or Require semicolons. One operation decodes one layer of character references.

Use Copy beside Output, or select the output text and copy it manually. Copy returns only the output value, including the final result of a chain. The panel does not render it as HTML.

About HTML Entity Encoder

Convert the five characters &, <, >, double quote and apostrophe into HTML references. Paste text into the editor to see the result. The page opens with HTML Entities and Encode selected; other conversions are available in the same panel.