HTML Entity Encoder and Decoder

This tool makes characters such as ampersands, angle brackets, and quotation marks visible as text in an HTML context.

Last updated: November 27, 2026  •  Published by: NOFYI Editorial Team  •  Category: Developer Tools

Workspace

The HTML Entity Encoder and Decoder is meant to convert special characters to HTML entities, or convert entities back to characters. Paste text in the workspace above, click Encode or Decode, and check the result before you rely on it.

What is the HTML Entity Encoder and Decoder?

HTML entities are codes that represent characters with special meaning in HTML. Encoding turns < into &lt;, > into &gt;, & into &amp;, and a double quote into &quot;. Decoding does the reverse. This matters when you show code samples on a page, store markup as text, or fix text that shows entity codes instead of symbols.

How to Use the HTML Entity Encoder and Decoder

  1. Paste or type text containing special characters or entity codes into the workspace input box.
  2. Click Encode to encode, or Decode to decode.
  3. Read the result box carefully. An encoded result should show entity codes such as &lt; and &amp;. A decoded result should show the plain characters.
  4. Tick “Also encode non-ASCII characters as numeric entities” only if you want letters beyond plain ASCII (such as é) encoded as numeric entities too.

Worked Example

Input tested on this page: <div> & "quote"

Observed workspace output: &lt;div&gt; &amp; &quot;quote&quot;

That is the correct encoded output: every special character is replaced by its entity, and the result can be pasted into HTML source so the browser shows the literal text <div> & "quote" instead of treating it as markup. Clicking Decode on that output returns the original text.

Limitations

  • Encoding covers the five named entities & < > " and ', plus numeric entities for non-ASCII characters when you tick that option.
  • Check the direction before you paste the result into a page: encoded output belongs in HTML source; decoded output is plain text.
  • Decoding handles decimal numeric entities (such as &#60;), hex numeric entities (such as &#x3C;), and the named entities " ' < >   © ® ™ … — – and &. Other named entities are left as they are.
  • Do not paste private or untrusted content into a public page.

Frequently Asked Questions

Does this tool encode HTML entities?

Yes. In the test above, <div> & "quote" becomes &lt;div&gt; &amp; &quot;quote&quot;.

Does it decode entities back to characters?

Yes. Decoding &lt;div&gt; &amp; &quot;quote&quot; returns <div> & "quote".

Does it encode non-ASCII characters?

Only if you tick the non-ASCII option. By default, letters such as é are left as they are; with the option ticked, é becomes é.

Which entities does decoding handle?

Decimal numeric entities (such as <), hex numeric entities (such as <), and the named entities " ' < >   © ® ™ … — – and &. Anything else is left unchanged.