HTML Entity Encoder / Decoder

Encode special characters to HTML entities and decode them back. Supports essential escaping, extended named entities, and numeric references — all in your browser.

Mode:
Encoded HTML

<h1>Hello & “World”</h1>

How to use HTML Entity Encoder / Decoder

  1. 1
    Choose Encode or Decode

    Select the Encode tab to convert plain text to HTML entities, or the Decode tab to convert entity-encoded HTML back to readable text.

  2. 2
    Paste or type your input

    Enter your text in the input panel. The output updates instantly as you type.

  3. 3
    Select an encode mode (Encode tab only)

    Choose Essential to encode only the five critical characters (& < > " '), or Extended to encode all named HTML entities and any remaining non-ASCII characters as numeric references.

  4. 4
    Copy or swap the result

    Click Copy to copy the output to your clipboard. Use the Swap button to send the encoded output straight into the Decode tab for round-trip verification.

Frequently Asked Questions

What is the difference between Essential and Extended encode modes?

Essential mode encodes only the five characters that must be escaped in HTML: & (→ &amp;), < (→ &lt;), > (→ &gt;), " (→ &quot;), and ' (→ &#39;). Extended mode additionally encodes all characters that have a named HTML entity — such as © (&copy;), € (&euro;), Greek letters, math symbols, and accented Latin characters.

What entity formats can the Decoder handle?

The decoder handles all three entity formats: named references (&amp; &copy; &mdash;), decimal numeric references (&#169; &#8212;), and hexadecimal numeric references (&#xA9; &#x2014;).

Does my text get sent to a server?

No. All encoding and decoding runs entirely in your browser using JavaScript string processing. Your text is never transmitted to any server.

Why do I need to encode HTML entities?

Characters like <, >, and & have special meaning in HTML. If they appear unescaped in page content or attributes, the browser may misinterpret them as markup, causing layout breaks or security vulnerabilities such as cross-site scripting (XSS). Encoding them as entities ensures they display correctly as literal characters.

Related Tools