HTML Entities Encode and Decode

This tool lets you encode and decode HTML entities: “&” becomes “&” and back, optionally with named, decimal or hexadecimal references for accented letters, the euro sign and other special characters. Your text never leaves the browser.

Source: WHATWG HTML Living Standard – Named character references. Updated: .

Paste or type, the conversion appears at once.

Your text stays in your browser – it is not sent, not stored and not added to the address bar.

My ToolboxYour inputs are saved in this browser only.

Result

Result
<p class="note">Price: 5 € & more – “free”</p>
Summary
11 characters replaced, 46 → 95 characters.
Common characters for reference
CharacterNameNumber
&&&
<&lt;&#60;
>&gt;&#62;
"&quot;&#34;
'&apos;&#39;
 &nbsp;&#160;
©&copy;&#169;
®&reg;&#174;
™&trade;&#8482;
€&euro;&#8364;
£&pound;&#163;
¥&yen;&#165;
¢&cent;&#162;
§&sect;&#167;
°&deg;&#176;
±&plusmn;&#177;
×&times;&#215;
÷&divide;&#247;
–&ndash;&#8211;
—&mdash;&#8212;
‘&lsquo;&#8216;
’&rsquo;&#8217;
“&ldquo;&#8220;
”&rdquo;&#8221;
…&hellip;&#8230;
•&bull;&#8226;
ä&auml;&#228;
ö&ouml;&#246;
ü&uuml;&#252;
Ä&Auml;&#196;
Ö&Ouml;&#214;
Ü&Uuml;&#220;
ß&szlig;&#223;
→&rarr;&#8594;

How it is calculated

HTML entities – what they are for

HTML entities (character references) stand for characters that have a special meaning in source code or are hard to type. The five most important are &amp; for the ampersand, &lt; and &gt; for the angle brackets, &quot; for the double quote and &#39; for the apostrophe. Without encoding, the browser would read a less-than sign in text as the start of a tag.

Named, decimal, hexadecimal

When to encode and when not

On UTF-8 pages accented letters and the euro sign may appear directly in text. You must encode the required characters whenever text is inserted into HTML, above all text from users: it prevents garbled display and is one building block against cross-site scripting. Depending on the place (HTML text, attribute, JavaScript, URL) different escaping applies.

Limits

The tool knows the common named references (Latin-1, typography, currencies, arrows, mathematics, Greek), not all of the more than 2,000 names in the WHATWG list. Unknown names stay unchanged when decoding and are reported. Decoding produces text, not active HTML.

Frequently asked questions

What are HTML entities?

Character references that stand for a character in source code, such as an ampersand, an angle bracket or an accented letter. They start with an ampersand and end with a semicolon.

How do I encode special characters for HTML?

Choose “Encode text into entities” and the “named” level. On UTF-8 pages, accented letters are also allowed without encoding.

How do I decode HTML entities?

Choose “Decode entities into text” and paste the text. Named, decimal and hexadecimal references are turned back into characters.

Which characters must I always encode in HTML?

The ampersand and the two angle brackets. In attribute values the quote character in use is added.

What is the difference between named and numeric entities?

Named ones have a readable name, numeric ones give the Unicode code point as a number. Numeric ones work for every character, named ones only for those that have a name.

Sources and legal basis

As of: · Editorial policy

Related tools