HTML Entity Encoder & Decoder

Escape the characters that can break a web page, or change accented letters and symbols into entities. Decode named and numbered entities back into text.

Questo contenuto è in inglese.

Esempi svolti

Escaping markup characters

<p>Fish & chips</p> with the basic option

&lt;p&gt;Fish &amp; chips&lt;/p&gt;

The angle brackets and ampersand become entities, so the page shows them as text instead of reading them as markup.

Decoding named and numbered entities

caf&eacute; and caf&#233; typed in the decode box

café café

A named entity and a numbered entity for the same letter decode to the same character.

Informazioni su HTML Entity Encoder & Decoder

HTML is the code behind web pages, and a few characters have a special job in it. A less-than sign starts a tag, an ampersand starts an entity, and quotation marks end attribute values. When these characters appear in text that a page should display as written, they must be replaced with entities, which are short codes that stand for the character. This tool performs that replacement in one step, changing &, <, >, double quotes and apostrophes into their plain forms so a page shows them correctly every time.

Entities come in three forms: named entities such as &eacute;, decimal numbers such as &#233; and hexadecimal numbers such as &#xE9;. All three can be decoded here, and the decoder also handles emoji and symbols. For wider compatibility, the full encoding option converts accented letters, currency signs, dashes and emoji into numbered entities, so a page or email template that cannot store those characters directly still shows them correctly. Unknown names are left unchanged and listed, so nothing is lost silently.

Come usare HTML Entity Encoder & Decoder

  1. Choose Encode to protect text before it goes into a web page, or Decode to turn entities back into normal characters.
  2. If you are encoding, pick whether to change only the special characters or also accented letters, symbols and emoji.
  3. Paste your text into the box. The result appears straight away below it.
  4. Copy the result, or read the message above it to check whether any names were left unchanged.

Usi comuni

  • Showing code samples or angle brackets as text inside a web page
  • Cleaning up text copied from a database export that contains &amp; and &lt;
  • Preparing accented names and currency symbols for an old email template
  • Checking how a symbol such as an em dash or a curly quote is written in HTML

Domande frequenti

What is an HTML entity?

An HTML entity is a way of writing a character inside an HTML document using a code that starts with an ampersand and ends with a semicolon. The name &copy; shows the copyright symbol, and the number &#169; shows the same symbol using its code point. Entities are used whenever a character might be mistaken for markup or might not be stored correctly by a system.

Why do the ampersand, angle brackets and quotes need to be encoded?

These characters are part of the HTML language itself. An ampersand starts an entity, the angle brackets start and end tags, and quotes end attribute values. If they appear in ordinary text without being encoded, a browser may read them as code, which can break the layout or let unwanted content into the page. Encoding them makes the browser show them as plain characters.

What is the difference between a named and a numbered entity?

A named entity uses a memorable word, such as &euro; for the euro sign, and only a limited set of names exists. A numbered entity uses the character code, written in decimal or hexadecimal, so it works for any character, including emoji. Both are valid HTML, and this decoder reads all three forms in the same pass.

Why does the decoder leave some entities unchanged?

The decoder only changes entities it recognises. A name that is not in its list, a number that is not a valid character, or a code point reserved for pairs of emoji is left exactly as it was written. The message above the result lists these entities, so you can check them by hand or look up the correct name.

Should I use the basic or full option when encoding?

Use the basic option for normal web text, which is usually enough because modern pages are stored in a format that handles accents directly. Use the full option when text must pass through an older system, an email template or a database that cannot store accented letters or symbols reliably. The full option converts every character outside plain English letters and punctuation into a numbered entity.