HTML Entity Decoder

Paste text full of codes like & or ’ and get back the characters they stand for.

FluffyShield Protected workspace
FluffyShield

Isolated workspace: other page scripts can't read your files. How FluffyShield works

Free · No upload · No sign-up · No usage quotas

Why does ’ turn into an apostrophe?

Because HTML reads a handful of numbers from an old Windows character set, not from Unicode. This decoder keeps to the same rule, so old text comes out the way a browser showed it.

How the codes are read
  1. Find each code that starts with &
  2. Look up a name in HTML's list, or read a number as a character
  3. Leave anything it doesn't recognise exactly as typed

What it does

Hex numbers too

’ is 146 written in hex, the base-16 numbers web code often uses, and decodes to the same ’.

A typo stays put

&nbps;, a slip for the no-break space, comes out exactly as typed.

Old names bend the rules

caf&eacutex decodes to caféx. A few old names count even with no semicolon and a letter straight after.

Limits One layer at a time: ’ comes back as ’, so paste the result in again.

Codes in the posts from an old website

An old shop website is being moved, and its posts arrive as plain text: Don’t miss our “Summer Sale” – ends Friday. Somewhere along the way, nobody turned the codes back into characters.

In a web page's source, a character can be written as a short code that starts with & and usually ends with ;. HTML calls these character references; most people call them entities. A browser swaps each one for its character as it draws the page, so on the old site this line looked fine. Outside a browser, in an export or a database, the codes stay as they are.

Some codes are names, like é for é. The rest are numbers, and a number is normally a code point, the number Unicode gives every character. Unicode's number for the curly apostrophe is 8217, though, and this line says 146.

Unicode's curly apostrophe isn't number 146

At 146, Unicode has no curly apostrophe at all, only a control code, an invisible character with no picture of its own. HTML reads them in another character set, Windows-1252, which older Windows programs used. It put its curly quotes and dashes in the stretch from 128 to 159, where Unicode keeps control codes.

In the textIn UnicodeDecoded’U+0092, a control code’“U+0093, a control code“”U+0094, a control code”–U+0096, a control code–

Four old numbers

Taken as Unicode numbers, all four would be invisible control codes. HTML reads them from the old Windows table instead, and gets punctuation. How we checked

The HTML Standard keeps a table for exactly that stretch, mapping each number to its Windows character, and browsers follow it. This decoder does too, so ’ and ’ both give ’.

It's the courtesy a post office shows a letter addressed in an old county name. The address is out of date, but everyone knows where it was meant to go, and it gets there.

A number HTML doesn't allow, such as 0, or one past the end of Unicode, comes out as �, the mark Unicode uses for something that couldn't be read.

Turning the codes back into characters

The box is the HTML entities to Text setting of FluffyBench's Text escaper.

  1. Paste the text, codes and all, into the Input box.

  2. Read the decoded words in the Text box, under Result if you're on a phone.

    The Text box holding Don’t miss our “Summer Sale” – ends Friday, with curly quotes and a dash, under Copy and Download.
    The Text box holding Don’t miss our “Summer Sale” – ends Friday, with curly quotes and a dash, under Copy and Download.

When the codes aren't HTML's

The text has %20 and %C3%A9 in it instead

URL encoder

Those are the % codes of web addresses. Its URL-encoded to Component setting reads them.

The codes start with a backslash and a u, inside double quotes

Text escaper

That's a JSON string. With From on JSON string and To on Text, "Don\u2019t" gives the same apostrophe.

Search FluffyBench