Skip to content
XUtilHub

HTML Entity Encoder & Decoder Online

Escape special characters as HTML entities (&, <, é) or decode entities back to text. Named, decimal and hex formats.

  • Free, no sign-up
  • Runs in your browser, nothing uploaded
Input
Output

About the HTML Entity Encoder / Decoder

Convert characters like <, >, & and quotes into HTML entities so they display safely in web pages, or decode named and numeric entities back into plain text.

Key features

  • Escape the five HTML special characters: & < > " '
  • Encode all non-ASCII characters as named, decimal or hex entities
  • Decode every named entity (&nbsp;, &copy;, &eacute;…)
  • Decode decimal (&#233;) and hex (&#xE9;) references
  • Emoji and characters beyond the BMP handled correctly
  • Runs locally in your browser

Escape and unescape HTML

When you want to show code like <div> on a web page instead of having the browser interpret it, special characters must be written as HTML entities. This tool converts text to entities and back.

The essential entities

CharacterNamedDecimalHex
&&amp;&#38;&#x26;
<&lt;&#60;&#x3C;
>&gt;&#62;&#x3E;
"&quot;&#34;&#x22;
'&apos;&#39;&#x27;
Non-breaking space&nbsp;&#160;&#xA0;

Other common entities

CharacterEntityCharacterEntity
©&copy;€&euro;
®&reg;£&pound;
™&trade;°&deg;
—&mdash;×&times;
–&ndash;…&hellip;

Encoding modes

ModeCafé <b> becomes
Special characters onlyCafé &lt;b&gt;
Named where possibleCaf&#233; &lt;b&gt;
DecimalCaf&#233; &#60;b&#62;
HexCaf&#xE9; &#x3C;b&#x3E;

Common uses

  • Showing code snippets in blog posts and documentation.
  • Cleaning scraped text full of &amp; and &#39;.
  • Preparing content for XML, RSS feeds and email templates.

Strip tags completely with HTML to Text, or turn Markdown into HTML with Markdown to HTML.

How to use the HTML Entity Encoder / Decoder

  1. Type or paste your text into the input box.
  2. Choose the options you want.
  3. The result updates instantly as you type.
  4. Copy the output or download it as a .txt file.

Frequently asked questions

Which characters must be escaped in HTML?

& and < always, > for safety, and " or ' inside attribute values. Escaping these five covers almost every case, which is what the default mode does.

What's the difference between named and numeric entities?

Named entities like &copy; are easier to read; numeric references like &#169; or &#xA9; work for every Unicode character, even those without a name.

Do I need entities for accented letters?

Not if your page uses UTF-8 (<meta charset="utf-8">), which nearly all modern pages do. Encoding everything is mainly useful for systems limited to ASCII.

Does escaping prevent XSS?

Escaping text inserted into HTML content is an essential part of preventing cross-site scripting, but different contexts (JavaScript, URLs, CSS) need different escaping. Use your framework's built-in escaping where possible.

Is my text sent anywhere?

No. All text tools run locally in your browser.

Do these tools support Unicode?

Yes. They handle Unicode text, including emoji and accented characters.

Last updated:

Related Text tools