HTML entities
MDV ToolsEscape text so a browser reads it as text, or turn entities back into characters. Type on either side.
How this works
Escaping replaces the characters that would otherwise be read as markup. Text
content escapes &, < and >, which is all
that text between tags needs. Attribute value also escapes both quote marks, so
the result is safe to drop inside "…" or '…'. Everything
non-ASCII adds every character above 7-bit ASCII, which is what you want for a file that
may be served without a declared UTF-8 encoding — and nowhere else, since a UTF-8 page carries
é perfectly well. Named entities are used where a standard short name exists;
tick the box to get numeric ones such as é throughout. Characters outside the
basic plane, emoji among them, are written as one numeric entity for the whole character rather
than as two halves of a surrogate pair.
Decoding is done by the browser's own HTML parser, through DOMParser, so every named
entity the HTML standard defines is understood — all two thousand-odd of them — along with decimal
and hexadecimal numeric forms. That is a parser reading a string, not a page being built: nothing
in what you paste is loaded or run, no script executes, no image is fetched, and no markup is
rendered. Tags are left as text rather than stripped: pasting <b> gives you
<b> back, because this page converts entities and does not edit HTML.
Two details that trip people up, and the page names both when it sees them. HTML's own rules let
some entities be written without the closing semicolon, so &foo decodes to
&foo; and text that was escaped twice decodes to something still holding
<, which the page points out rather than leave you puzzling. Each side is capped
at 200,000 characters.
Everything runs in this tab. Nothing is uploaded and nothing you paste is stored; the Dark button keeps its own setting in this browser's local storage.