HTML entity encoder

Encode and decode HTML entities

Runs in your browser. Nothing is uploaded.

How it works

HTML entities let you show characters that would otherwise be read as code. For example, < is written &lt; so the browser shows it as text and doesn’t treat it as a tag. Encode text to make it safe to display, or decode it to get the original back. We warn you about double encoding.

Special characters become &name; or &#number;.

Named entities such as &copy; are easy to read. Numeric ones such as &#169; work for any character.

Worked example. <b> becomes &lt;b&gt;, so a browser shows it as text instead of reading it as a tag.

Advertisement

Examples

CharacterNamedNumeric
<&lt;&#60;
&&amp;&#38;
"&quot;&#34;
©&copy;&#169;

What this tool doesn’t cover

  • Encoding text helps, but it isn’t a full defence against script injection. Use your framework’s escaping too.

Questions

Which characters must be encoded?

At least &, <, > and quotes inside attributes.

What is double encoding?

Encoding text twice, so &amp; becomes &amp;amp;. We warn you when it’s likely.

Is my data uploaded?

No. Everything runs in your browser.

What is an HTML entity?

A code that shows a character safely in HTML. For example, &lt; shows a less-than sign without starting a tag.

How do I show code on a web page?

Encode the characters <, >, and &, then paste the result into your page. The browser shows the code and doesn’t run it.

Advertisement

Was this useful?

Built by QuickToolz.

Sources: WHATWG HTML: named character references (opens in a new tab)

Submit ProductLoginAccountBlogAdvertise