SmartKitio

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 &amp;, < with &lt;, > with &gt;, " with &quot;, and ' with &#39;. 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

  1. Paste the text or markup to escape.
  2. Copy the encoded output into your HTML.

Examples

  • Code sample

    <b>Hi</b> becomes &lt;b&gt;Hi&lt;/b&gt;, which the browser displays as <b>Hi</b> instead of bold text.

  • Ampersand

    Tom & Jerry becomes Tom &amp; 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.