Skip to main content

HTML Entity Encoder

Encode and decode HTML entities — convert &, <, >, quotes and special characters

Runs locally in your browser🆓Free — no sign-up🔒100% Private

HTML uses angle brackets, ampersands, and quotation marks as syntax characters that structure markup. When these characters appear in page text content without encoding, browsers may misinterpret them as HTML tags or attribute delimiters, breaking the page layout or creating cross-site scripting (XSS) security vulnerabilities. HTML entity encoding converts each special character to its safe named or numeric entity equivalent: ampersand becomes &amp;, less-than becomes &lt;, and greater-than becomes &gt;. This tool encodes any text to safely displayable HTML entities for insertion into HTML pages, and decodes encoded strings back to readable characters for debugging entity-encoded content. A common use case is embedding code snippets into web pages or blog posts. A developer writing a tutorial about JavaScript arrow functions needs to display the characters < and > literally on screen, and without proper encoding those characters would be swallowed by the browser as tag delimiters. Pasting the snippet here produces the correctly encoded version ready to drop into a pre or code element. Another frequent scenario is handling user-generated content in a CMS or comment system: before storing or rendering a submitted review that contains an ampersand in a product name like "Nuts &amp; Bolts Hardware," the raw string must be encoded so it does not corrupt surrounding markup. A third situation is troubleshooting API or database payloads that arrive with entity sequences already applied — decoding mode instantly translates strings like &#39; or &quot; back to readable apostrophes and quotation marks, saving time spent parsing them manually. Front-end developers, back-end engineers sanitizing template output, and technical content writers preparing documentation all reach for this tool regularly. All encoding and decoding runs entirely in your browser — no text is sent to any server — so sensitive source code, proprietary content, or personal data never leaves your machine.

Common HTML entities reference ▾
&&amp;
<&lt;
>&gt;
"&quot;
'&apos;
©&copy;
®&reg;
&trade;
&euro;
£&pound;
¥&yen;
°&deg;
±&plusmn;
×&times;
÷&divide;
&hellip;
&mdash;
&ndash;

How to use HTML Entity Encoder

  1. 1.Paste your text containing special characters into the input field.
  2. 2.Click 'Encode' to convert characters like &, <, >, ', and " into their HTML entity equivalents (&amp;, &lt;, etc.).
  3. 3.Click 'Decode' to convert HTML entities back to plain characters.
  4. 4.Use 'Named entities' mode for human-readable output (&copy;, &trade;) or 'Numeric' mode for maximum compatibility.
  5. 5.Click 'Copy' to copy the encoded or decoded text.

Key Features

Encode and decodeConvert special characters to HTML entities and back in both directions.

Named and numeric entitiesChoose human-readable named entities (&amp;, &copy;) or numeric entities (&#38;, &#169;).

Paste and goPaste text with special characters and see the encoded output immediately.

Safe for HTMLEncoded output is safe to embed in HTML attributes, text nodes, and JSON strings.

Frequently Asked Questions about HTML Entity Encoder

Paste text containing special characters (like <, >, &, ", ©) into the input above and click Encode. Special characters are converted to their safe HTML equivalents (&lt;, &gt;, &amp;, &quot;, &copy;).
Share:
All Tools