←
Developer

HTML Entity Encoder

Loading the tool…

Ready when you are.Runs in this browser · nothing is uploaded

Escape and unescape HTML entities

  • Free
  • No sign-up
  • No upload
  • Works offline

Tool facts

Price
Free, no sign-up, no watermark
Are files uploaded?
No. Everything is processed in this browser, on your device.
Offline use
Works without a connection once this page has loaded
Browser
A recent Chrome, Edge, Firefox or Safari, on computer or phone.

Check it yourself: press F12, open the Network tab, then use the tool. No request carries your data.

About HTML Entity Encoder

This tool converts text into HTML entities and decodes HTML entities back into plain characters. Encoding replaces characters that have a meaning in HTML, such as < > & and quotes, with references like &lt; and &amp;, so the text displays literally instead of being treated as markup. Decoding does the reverse and understands every named reference defined in the HTML standard, plus decimal (&#169;) and hexadecimal (&#xA9;) numeric references.

Choose how much to encode: only the five special characters, which is enough to place text safely inside an element or a quoted attribute; all non-ASCII characters as well, useful for files that must stay pure ASCII; or every symbol except letters, digits and whitespace. Output can use named entities such as &eacute; and &euro; where one exists, or always decimal or hex code points, including emoji outside the Basic Multilingual Plane. Decoding uses your browser's HTML parser in a mode that renders nothing and runs no scripts, and nothing is uploaded.

HTML Entity Encoder runs entirely in your browser. Your data is processed on your device and is never uploaded to Qiyi or anyone else.

How to use HTML Entity Encoder

  1. Paste text or HTML into the Input box.
  2. Choose Encode or Decode under Direction.
  3. When encoding, pick a Scope (Special only, Non-ASCII or Everything) and a Format (Named, Decimal or Hex), and decide whether to encode quotes.
  4. Copy the result from the Output box, or click Use output as input to convert it back.

Frequently asked questions

Which characters must be escaped in HTML?

Inside element content you must escape & and <, and escaping > is good practice. Inside an attribute value you must also escape the quote character that delimits it, " or '. With Special only and Encode quotes turned on, this tool escapes exactly & < > " and ', which is what server-side escaping functions such as PHP htmlspecialchars with ENT_QUOTES do.

Should I use named or numeric entities?

Both are valid in HTML5. Named entities like &copy; are easier to read, but only some characters have names, and XML only knows &amp; &lt; &gt; &quot; and &apos;. Numeric references like &#169; or &#xA9; work for every Unicode character in both HTML and XML. In this tool, Named falls back to decimal when a character has no name.

Why is the apostrophe encoded as &#39; and not &apos;?

&apos; is defined in XML and HTML5 but not in HTML 4, and some older email clients do not recognise it. &#39; means the same character and works everywhere.

Is encoding HTML entities enough to prevent XSS?

It is enough for text placed inside HTML element content or a quoted attribute value. It is not enough inside JavaScript, CSS, unquoted attributes or URLs such as href="javascript:…", which each need their own escaping or validation.

Can it decode entities without a semicolon, like &amp or &copy?

Yes, decoding follows the HTML parsing rules browsers use, so legacy references without the trailing semicolon are decoded the same way a browser would display them.

· Free · Runs in this browser · nothing is uploaded

Drop any file here
Drop it to see which tools can open it