Text that contains < and &, or a string full of &nbsp; and &#233;.
2
Pick the direction
Encode to entities, or decode back to characters.
3
Copy the result
Decoding shows the real characters, not a rendered page.
The five characters that matter
In HTML text, & starts an entity and < starts a tag, so both must be escaped. Inside an attribute value, the quote that delimits the attribute must be escaped too. The five are &, <, >, " and ', and escaping them is enough for almost every case.
Over-escaping is not harmless in every context: an escaped character inside a script block, a JSON string or a URL becomes part of the data. Escape for the place the text is going, not for safety in general.
Named and numeric entities
Named entities such as and — are readable; numeric ones such as é and é work for any character. HTML5 defines a long list of names, and browsers also accept many names without the trailing semicolon, which is a legacy quirk the decoder tolerates.
The option to encode every non-ASCII character as a numeric entity produces text that survives a system that mangles UTF-8. It is ugly and it works, which is why it is still used in old email templates and some CMS pipelines.
Where entities still matter
Text inserted into an HTML template must be escaped or it becomes markup, which is how comment boxes get broken layouts and worse. The same rule applies to emails built from templates and to XML, which has its own five predefined entities.
Decoding is the reverse: it turns & back into & once. That means a string encoded twice needs decoding twice, and a decoder loop that runs until nothing changes is a common way to corrupt data. This one decodes once. For URL escaping instead, use the URL encoder.
Frequently asked questions
Can it decode &nbsp;?Yes. Named, decimal and hexadecimal entities are all turned back into their characters.Does it encode every non-ASCII character?Only if you tick the option. Otherwise only the five HTML-significant characters are escaped.Will it double-encode?It escapes & first, so text is not double-encoded in one pass. Decoding runs once, so an encoded string decodes by exactly one level.Does it work for XML?Yes. XML's five predefined entities are a subset of the same names, so the same encode and decode work.Is the text uploaded?No. The conversion happens in this tab with string replacement and the browser's own entity decoder.Should I escape quotes in text content?Not necessary, but harmless except inside script and style blocks. Escape quotes when the text goes into an attribute.