HTML Entity Encoder & Decoder

Escape special characters like < > & and quotes so text displays safely in HTML, or decode entities such as &copy; and &#8364; back into readable characters.

  • Named, decimal & hex
  • Decodes all 2,000+ entities
  • Instant & private

How to use the HTML Entity Encoder tool

  1. Paste your text or HTMLEnter the text to encode, or HTML code full of entities to decode.
  2. Choose Encode or DecodeEncode turns special characters into entities; Decode turns entities back into characters.
  3. Pick an encoding styleEscape only the five HTML special characters, or also convert accents and symbols to named, decimal or hex entities.
  4. Copy the resultCopy the output, or click “Use result as input” to reverse the operation.

Features

  • Safe escapingConverts & < > " and ' so user text can’t break your HTML.
  • Three entity stylesNamed (&copy;), decimal (&#169;) or hexadecimal (&#xA9;) for non-ASCII characters.
  • Complete decodingUses the browser’s own HTML parser, so every named entity is recognized.
  • Emoji-safeCharacters outside the basic plane, like emoji, become a single correct entity.
  • Non-breaking spacesOptionally keep double spaces visible with &nbsp;.

What are HTML entities?

Some characters have a special meaning in HTML. A < starts a tag and an & starts an entity, so writing them directly in text can break a page or create security holes. HTML entities are codes that represent these characters safely: &lt; displays as <, and &amp; displays as &. Entities can also represent characters that are hard to type, such as © or €.

The five characters you must escape

CharacterEntityWhy
&&amp;Starts every entity
<&lt;Starts a tag
>&gt;Ends a tag
"&quot;Ends attribute values in double quotes
'&#39;Ends attribute values in single quotes

Common entities

SymbolNamedDecimal
(space)&nbsp;&#160;
©&copy;&#169;
®&reg;&#174;
™&trade;&#8482;
€&euro;&#8364;
£&pound;&#163;
—&mdash;&#8212;
…&hellip;&#8230;
“ ”&ldquo; &rdquo;&#8220; &#8221;

Do I still need entities for accents and symbols?

Not usually. Modern pages are saved as UTF-8 (with <meta charset="utf-8">), so characters like é, ñ, € and emoji can be written directly. Entities for non-ASCII characters are mainly useful in old systems, email templates, XML that must stay ASCII, or when you can’t be sure about the file’s encoding. The five special characters above, however, must always be escaped in text and attributes.

Security note

Escaping user input before inserting it into HTML is a key defence against cross-site scripting (XSS). In real applications, let your framework’s templating engine do this automatically, for example Laravel Blade’s {{ }}, React’s JSX or Django templates. To encode text for URLs instead, use the URL Encoder & Decoder; for binary data, use the Base64 Encoder.

Frequently asked questions

What does HTML encoding do?
It replaces characters with special meaning in HTML, like < and &, with entities such as &lt; and &amp;, so they display as text instead of being treated as code.
How do I decode HTML entities?
Paste the text and click Decode. Entities such as &amp;, &copy; and &#8364; are turned back into &, © and €.
What is the difference between named and numeric entities?
Named entities use a word (&copy;); numeric ones use the character’s Unicode number in decimal (&#169;) or hex (&#xA9;). All display the same.
What is &amp;nbsp;?
A non-breaking space: a space that keeps two words on the same line and isn’t collapsed when several spaces appear in a row.
Is my code uploaded?
No. Encoding and decoding happen entirely in your browser.