HTML encoder

Type or paste text, such as a code sample or a message from a user, and see it escaped below: & < > " and ' become &amp; &lt; &gt; &quot; and &#39;, so a browser shows them instead of reading them as markup.

Only what needs it

Just the five characters that mean something in HTML and XML are escaped. Letters, accents and emoji are left as they are, since pages are UTF-8.

Code samples

Escape a snippet of HTML or XML to show it on a page inside <pre> or <code>, in a blog post or in documentation.

Not a sanitizer

Escaping makes text safe to put between tags or inside a quoted attribute. It does not make HTML safe to run: to allow some markup from users, use an HTML sanitizer.

Safe in attributes too

Quotes are escaped as well (&quot; and &#39;), so the result is safe inside an attribute value in either kind of quotes, such as title="…" or alt='…'.

Private: nothing is uploaded

Formatting, checking and comparing all happen in your browser. Your documents are saved in the browser's own storage on this computer, not on a server, so they never leave your device.

With your permission, we count anonymous visits (which pages and tools are used), never what you type. See Privacy.

Questions

Which characters are escaped?

& < > " and ', the ones that mean something in HTML and XML. Other characters are left as they are.

Is my data uploaded anywhere?

Your documents aren't: everything runs in your browser, and they are saved on your computer, in the browser's storage for this site. With your permission we count anonymous visits, never their content.

More tools