Developer · HTML

HTML Entity Encoder & Decoder Utility

Convert raw HTML markup into safe escaped entities for blogs, documentation, and XML feeds—or decode named and numeric character references back into readable text.

✓ 100% Browser-Local · Zero Upload Reviewed: 2026-11-26

Initializing local browser workspace...

Escape Markup Safely and Decode Scrambled Entities

Unescaped < or & characters inside HTML templates or XML sitemaps break rendering and can introduce Cross-Site Scripting (XSS) vulnerabilities. Conversely, scraped feeds and CMS exports often arrive full of unreadable &amp; and &#39; sequences that need decoding.

  • Escapes all five critical HTML characters (&, <, >, double and single quotes)
  • Decodes full HTML5 named entities (&copy;, &euro;, &mdash;) and numeric codes
  • Instant live update on keystroke with zero page reload
  • Ideal for preparing code snippets inside HTML <pre><code> blocks
  • 100% client-side execution with one-click copy

Step-by-Step Guide

  1. Paste raw HTML code or entity-encoded text into the Input box.
  2. Click Escape HTML Entities to convert markup characters into safe &lt;, &gt;, &amp;, &quot;, and &#39; sequences.
  3. Click Decode Entities to turn HTML character references back into plain UTF-8 characters.
  4. Click Copy Output to drop the cleaned text directly into your template or CMS.

Three Common HTML & XML Entity Pitfalls

Unescaped Ampersands Breaking XML Sitemaps & RSS

While HTML5 browsers forgive bare & in text, strict XML parsers (including Googlebot reading sitemap.xml) reject unescaped & in URLs—always encode & as &amp; inside XML.

Using Named HTML Entities Inside XML

XML only defines five named entities (&amp;, &lt;, &gt;, &quot;, &apos;). Entities like &nbsp; or &copy; cause XML parse errors unless written as numeric references (&#160;) or raw UTF-8.

Double-Escaping &amp;amp; in Templates

Modern frameworks like Astro and React escape text interpolations automatically. Pre-escaping data before passing it to an auto-escaping template displays literal &amp; to users.

Everyday Web Publishing & SEO Uses

  • Preparing HTML/SVG code examples to embed cleanly inside technical documentation and tutorials.
  • Cleaning entity-encoded titles and meta descriptions exported from legacy WordPress or Shopify databases.
  • Validating properly escaped URLs inside custom sitemap.xml and RSS feeds.

Frequently Asked Questions

Which five characters must always be escaped in HTML?

Ampersand (& -> &amp;), less-than (< -> &lt;), greater-than (> -> &gt;), double quote (" -> &quot;), and single quote (' -> &#39;).

Do I still need HTML entities for accents or currency symbols in UTF-8 pages?

If your page declares <meta charset="utf-8">, raw UTF-8 characters like €, ¥, é, and 日本語 render natively without entities—only reserved markup characters need escaping.

Is decoding untrusted HTML via this tool safe?

Yes—decoding uses a detached textarea element without executing scripts or inserting live DOM markup.

Local Privacy Guarantee: All HTML escaping and entity decoding happen strictly inside your browser tab.