Buy me a coffee

HTML Entity Encode

Escape text so it shows as text in HTML instead of being treated as markup.

Runs in your browser. Nothing you type or drop here is sent anywhere.

About HTML Entity Encode

Characters like < and & have special meaning in HTML. Encoding them as &lt; and &amp; makes the browser display them literally, which is also how you safely show user input or code samples on a page.

Optionally, every non-ASCII character can be turned into a numeric entity (&#233;) for systems that can't handle UTF-8.

Frequently asked questions

Which characters are escaped?

Always & < > " and '. Tick “Encode all non-ASCII” to also escape accented letters, symbols and emoji.

Is this enough to prevent XSS?

Escaping is the core of safe output in HTML text, but attributes, URLs and scripts each need their own encoding. Use your framework's escaping functions in real code.

Related tools