HTML Entity Encode and Decode

Show code on a web page without the browser running it, put text safely inside an HTML attribute, or turn a string full of & and ' back into normal text.

  • Free
  • Runs in your browser
  • Named and numeric entities
  • No sign-up
How it works

How It Works

Escape or unescape HTML in three steps.

01

Choose Encode or Decode

Encode makes text safe for HTML, Decode makes entities readable.

02

Paste your text

A code sample, a product title or a database value full of entities.

03

Copy the result

Paste it into your page, template or CMS.

About

What are HTML entities?

Five characters have a special meaning in HTML: < and > start and end tags, & starts an entity, and double and single quotes end attribute values. To show them as text you write them as entities instead: &lt;, &gt;, &amp;, &quot; and &#39;. Entities can also name any character by number, such as &#233; for é, which helps when a system cannot handle UTF-8.

Escaping text before inserting it into a page is one part of preventing cross-site scripting. Inside <script> blocks, URLs and CSS, different escaping rules apply, so rely on your framework's escaping there.

The five that matter

Encoding escapes & < > " and ', which is enough for text inside elements and attributes.

Numeric option

Optionally writes every non-ASCII character as &#number;, for old email templates and systems that mangle UTF-8.

Decodes every entity

Named (&nbsp;, &copy;, &eacute;), decimal (&#233;) and hex (&#xE9;) entities are decoded by your browser's own HTML parser.

Nothing runs

Decoding reads the text only; scripts in the input are not executed.

Features

Why Use This Entity Tool

Clean escaping in both directions.

Show code samples

Paste HTML and get text you can put inside <pre> without the browser rendering it.

All named entities

Decoding uses the browser's full entity list, not a short table.

UTF-8 fallback

The non-ASCII option helps with email clients and legacy systems.

Private

Everything runs in the browser tab.

✓ No Registration✓ Free✓ Browser-based✓ Text Stays Local
FAQ

Frequently Asked Questions

Questions people ask about the HTML entity encoder and decoder.

Inside text, < and & must be escaped. Inside an attribute value, the quote character that wraps it must be escaped too. Escaping all five (& < > " ') is the safe default and is what Encode does.