HTML Encoder
Escape text so it displays literally inside HTML, for example to show a code sample on a web page.
Your input stays in your browser. Nothing is uploaded.
About this tool
Five characters are replaced: & with &, < with <, > with >, " with ", and ' with '. Everything else, including accented letters and emoji, is left unchanged, which is correct for pages served as UTF-8. Escaping is necessary for showing code, but it is not a full defence against cross-site scripting; frameworks and template engines should handle output escaping in production.
How to use it
- Paste the text or markup to escape.
- Copy the encoded output into your HTML.
Examples
Code sample
<b>Hi</b> becomes <b>Hi</b>, which the browser displays as <b>Hi</b> instead of bold text.
Ampersand
Tom & Jerry becomes Tom & Jerry.
FAQ
Why aren't accented letters encoded?
Modern pages use UTF-8, where é and other characters can be written directly. Only characters with a special meaning in HTML need escaping.
Can I use the output in an attribute?
Yes. Quotes and apostrophes are escaped, so the text is safe inside a quoted attribute value.
Is my text uploaded?
No.

