HTML Encoder

Any text you drop into an HTML document shares the page with markup: a stray < starts a tag, a bare & starts an entity, and an unescaped quote can terminate an attribute early. Encoding converts those characters into safe entities — &lt;, &gt;, &amp;, &quot;, &#39; — so the browser renders your text as text. It is also the first line of defense when displaying user-generated content: encoded HTML cannot inject markup.

Paste your text above and the encoded version appears instantly. Encoding is done in the correct order (& first, so nothing double-encodes), apostrophes become the universally supported &#39;, and an optional checkbox escapes non-ASCII characters as numeric references like &#x1F600; for ASCII-only pipelines such as legacy email templates.

FAQ

Why did my &amp; become &amp;amp;?

Encoding escapes every ampersand, including the ones inside existing entities — so encoding already-encoded text encodes it twice. That is correct behavior, not a bug. If you meant to go back to plain text, use the HTML decoder instead.

Is HTML encoding the same as URL encoding?

No — a very common mix-up. HTML entities (&lt;) protect text inside a document; percent-encoding (%3C) protects text inside a URL. For links and query strings, use the URL encoder.

When do I need the non-ASCII option?

Only when the output must be pure ASCII: old email templates, charset-locked legacy systems, or pipes that mangle UTF-8. For normal web pages, UTF-8 needs no escaping.

Read the full HTML Entity Encoder/Decoder guide and the HTML Entity Encoder/Decoder API reference.