Format Code Now
/

HTML Decode String

ED-32

Paste text that contains HTML entities and click Decode to get plain characters. Named entities and numeric references in decimal or hex are all handled.

Runs in your browser. Nothing is uploaded.

Text with HTML entities

Decoded

How to use it

  1. Paste the encoded string into the input box.
  2. Click Decode.
  3. Copy the plain text, or download it as a .txt file.
  4. To go back, paste plain text and click Encode, after choosing the encode options.

Which entities are decoded

Numeric references such as é and é are decoded for any valid Unicode character. Named entities come from a fixed list of 258 names: the HTML 4 set plus apos and a few common HTML5 names. HTML5 defines about 2,200 names, so a rarely used one is left as it is. Named entities need their closing semicolon to be decoded; numeric ones are decoded even without it, as browsers do.

What it does not do

This is text replacement. It does not parse HTML, strip tags, run scripts or fix broken markup, so a string such as &lt;b&gt; becomes the characters <b> and nothing more. References from 128 to 159 are read as Windows-1252 characters, like in a browser, so &#150; becomes an en dash. Zero, surrogates and values above 10FFFF give an error.

Error messages and what to do

MessageWhat it meansFix
is not a valid Unicode characterA numeric reference is zero or above U+10FFFF.Use a number between 1 and 1114111 (10FFFF in hex).
is half of a surrogate pairA reference such as &#55357; is only half of an emoji.Write the whole character as one reference, for example &#128512;.

Questions people ask

How do I decode HTML entities in a string?

Paste the string and click Decode. Each entity, such as &amp; or &#8364;, is replaced by the character it stands for. The result is plain text that you can copy or download.

What is the difference between &#233; and &eacute;?

Both mean the letter é. The first is a numeric reference by code point, the second a named entity. Numeric references work for every Unicode character, while named ones exist only for a fixed list.

Why is an entity still there after decoding?

Either the name is not in the tool list of 258 names, or the semicolon is missing. Named entities need the semicolon. Add it, or replace the name with a numeric reference such as &#8212;.

Does decoding remove HTML tags?

No. Decoding only replaces entities. If the text holds tags written as &lt;p&gt;, you will get the characters <p>. Stripping or rendering tags is a different job and is not done here.

Can I encode a string back to HTML entities?

Yes, use the Encode button. It always converts & < > " and the apostrophe, and can also convert every non-ASCII character to a name, a decimal reference or a hex reference, depending on the options you pick.

About this tool

Decodes numeric references (&#233; and &#xE9;) and 258 named entities, which is a fixed list that covers the HTML 4 names plus a few common HTML5 ones. HTML5 defines about 2,200 names, so a rarely used name is left as it is. A reference without its semicolon is only decoded in numeric form. Numbers 128 to 159 are read as Windows-1252 characters, as browsers do, and invalid numbers or half a surrogate pair give an error. Tags are not parsed, removed or rendered: this is a text replacement, not an HTML parser.

Format Code Now: free, no ads, no accounts. Your input stays in your browser.