In HTML, a few characters are reserved. A < starts a tag, an & starts an entity, and a quote ends an attribute value. If you want the browser to show one of these as plain text, such as a code sample, a maths expression or a company name like “AT&T”, you write it as an entity: <, &, ". This tool converts in both directions.
Encoding
Choose Encode and paste your text. Five characters are replaced: the ampersand with &, less-than with <, greater-than with >, a double quote with " and an apostrophe with '. Everything else, including accented letters and emoji, is left as it is, which is the modern way: pages are served as UTF-8 and have no need to turn “é” into é.
<p class="note">Tom & Jerry's "show"</p>
becomes
<p class="note">Tom & Jerry's "show"</p>
That is exactly what you put into a page, or into the content of a <pre> block, when you want the browser to display the original line rather than act on it.
Encoding matters for security as well as display. Putting user-supplied text into a page without escaping it is how cross-site scripting happens, because a visitor can type a script tag and have it run. Any code that builds HTML from untrusted text should escape it, and it is best done by your framework’s own functions, not by hand. This tool is for the occasional manual job.
Decoding
Choose Decode to turn entities back into characters. Two kinds are handled: numeric entities, in decimal (©) or hex (©), which cover any character at all, and a small set of named ones: &, <, >, ", ' and .
That last point deserves honesty. HTML defines more than two thousand named entities, such as ©, é and …. This tool decodes only the six above and numeric ones, and leaves the others as they are. If you have text with many named entities, decode it through a browser, or replace them with their numeric forms first. For a page’s worth of HTML where you only want readable text, remove HTML tags does the tag stripping and the same entity decoding in one go.
Common questions about entities
An is a non-breaking space; it looks like a space but stops the line breaking there, and it is often the culprit when text refuses to wrap or a space cannot be found. After decoding, it appears as an ordinary space. If you need to see what a character is, the text to Unicode converter gives you its code point, which is also the number in a numeric entity.
For other encodings, see URL encoding and Base64.