HTML Escape / Unescape

Escape < > & " ' into HTML entities so text displays safely in a web page, or decode entities like &amp; &nbsp; &#8377; back to characters — in your browser.

Suggested tools

CSV to HTML

Convert CSV into an HTML table.

CSVHTML
Open Tool

HTML Formatter

Indent and tidy HTML, or minify it.

HTML
Open Tool

HTML Minify

Remove comments and extra whitespace from HTML safely.

HTML
Open Tool

Markdown to HTML

Convert Markdown into HTML instantly.

MDHTML
Open Tool

HTML to Markdown

Convert HTML into Markdown instantly.

HTMLMD
Open Tool

JSON Escape / Unescape

Turn text, JSON or XML into a JSON string literal, or unescape it back.

JSONTEXT
Open Tool

About HTML Escape / Unescape

HTML Escape converts the five characters that have special meaning in HTML — & < > " ' — into entities (&amp; &lt; &gt; &quot; &#39;). Use it to show code samples on a web page, put user text inside an attribute, or prevent text from being interpreted as tags.

HTML Unescape does the opposite and understands far more than the basics: named entities such as &nbsp;, &copy;, &euro; and the full Latin-1 set, plus decimal (&#8377;) and hexadecimal (&#x1F600;) references — including emoji. Everything runs locally in your browser — the text you paste is never uploaded.

How to use HTML Escape / Unescape

  1. Paste the text or HTML.
  2. Press Escape to encode special characters, or Unescape to decode entities.
  3. Copy the result into your page, template or code.

Key features

  • Escapes & < > " and ' — safe in text and attributes
  • Decodes named, decimal and hex entities
  • Emoji and characters beyond the basic plane decode correctly
  • Unknown entities are left untouched, never mangled

Example

Special characters become entities, so the text displays instead of being treated as a link.

Input
<a href="/search?q=tea&cup">Tea & "Cups"</a>
Output
&lt;a href=&quot;/search?q=tea&amp;cup&quot;&gt;Tea &amp; &quot;Cups&quot;&lt;/a&gt;

When to use HTML Escape / Unescape

  • Showing HTML code on a web page, in a blog post or in documentation.
  • Putting user-provided text inside an HTML attribute safely.
  • Reading text full of &amp; and &#39; entities copied from page source or an email.

Tips and common problems

  • Escape text exactly once — escaping twice shows "&amp;amp;" on the page.
  • Modern templating frameworks escape automatically; escape by hand only when building HTML strings yourself.
  • Unescape understands named, decimal and hex entities, including emoji.

Frequently asked questions

Escaping these characters is the core defence for text placed in HTML content and quoted attributes. Text inserted into JavaScript, URLs or CSS needs different escaping, so use your framework's built-in encoding for those contexts.