Encoding

HTML entity encoder

Escape & , < , > , and both quote characters as HTML character references. For example, <p>Hello</p> becomes &lt;p&gt;Hello&lt;/p&gt; .

Text Input

0 chars · 0 words · 0 lines

Get QR code
Copy to clipboard
Save to file

HTML Encoded Output

0 chars · 0 words · 0 lines

Get QR code
Copy to clipboard
Save to file

Escape text for display in HTML

Paste the text you want to display literally. This encoder replaces five characters. An ampersand becomes &amp;, less-than becomes &lt;, greater-than becomes &gt;, a double quote becomes &quot;, and an apostrophe becomes &#039;.

For example, <b>Tom & Jerry</b> becomes &lt;b&gt;Tom &amp; Jerry&lt;/b&gt;. When that encoded string appears in an HTML text node, the browser displays the tag characters as text. See the HTML character reference list.

Encode the original text once

Existing entity references contain an ampersand, so encoding &lt; produces &amp;lt;. That is expected when the original input is already encoded. Use the HTML entity decoder when you need to restore readable characters instead.

This tool escapes text. It does not sanitize a document or provide context-aware escaping for JavaScript, CSS, or URL values. For percent escapes in a URL component, use the URL encoder.

Common questions

Does this encode every Unicode character?
No. It replaces ampersands, angle brackets, double quotes, and apostrophes. Other text, including accented characters and emoji, stays unchanged.
Why does &lt; become &amp;lt;?
The encoder escapes the ampersand in the existing reference. Encode original text once to avoid an extra layer of entity encoding.
Share

marduc812

SourcePrivacy

© 202620261105_99d99aa