Skip to content

HTML Entity Encoder / Decoder

The HTML Entity Encoder / Decoder converts special characters to their HTML entity equivalents (for example & becomes &amp; and < becomes &lt;) and reverses the process instantly. Choose between encoding only the unsafe characters or every non-ASCII character, with named or numeric entities. Built for developers, content editors and technical writers who need to embed code snippets, user content or special symbols in HTML without breaking the markup.

Input

Mode
Characters to encode

Needed inside attribute values. Text between tags only needs & < >.

Names come from the HTML 4 set every browser and email client knows; other characters are numeric.

Input chars
76
Output chars
119
Encoded
11
Encoded
&lt;p class=&quot;note&quot;&gt;Café &amp; crème brûlée: &quot;5 &gt; 3&quot; isn&#39;t news. © 2026, €12 → 😀&lt;/p&gt;

How to use

  1. Paste your text or HTML and choose Encode or Decode.
  2. When encoding, choose which characters to convert (only & < > " ', or every non-ASCII character too) and whether to use named or numeric entities.
  3. The result updates as you type, with character and entity counts.
  4. Copy the output, or select Use output as input to reverse it or to decode text that was encoded twice.

Why use this tool?

Encoding HTML entities by hand is error-prone and slow: one missed ampersand or angle bracket can break a template or open an XSS hole. This tool encodes and decodes in your browser, so nothing is sent to a server, and it's faster than a reference table or a one-off script.

Frequently asked questions

What is the HTML Entity Encoder / Decoder?

A browser-based tool that converts special characters like <, >, & and " into their safe HTML entity forms (&lt;, &gt;, &amp;, &quot;) and reverses the process, decoding entity strings back into readable text.

When should I encode vs. decode HTML entities?

Encode when you need to display raw code or user-submitted text inside HTML, for example to show a <script> tag literally on a page without it running. Decode when an API response or CMS export contains escaped entities (like &amp;amp; or &#39;) and you need the readable version. Always encode output; never assume input is already safe.

Should I use named or numeric entities?

Named entities like &eacute; are easier to read; numeric ones like &#233; work for every Unicode character, emoji included. With named entities on, this tool uses names from the HTML 4 set that every browser and email client understands and falls back to numeric references for everything else.

Is it free?

Yes, the HTML Entity Encoder / Decoder is free with no signup required. It runs entirely in your browser, so nothing you paste is uploaded. Built by the Canvas Builder team.

Stop tweaking snippets. Build the whole site

This tool fixes one piece. Canvas Builder builds the entire page from a single prompt: sections, copy, styling, and responsive layout. You own the code.