HTML Encoder / Decoder
Encode and decode HTML entities.
The output will appear here.How it works
HTML entities let a document contain characters that would otherwise be parsed as markup. Encoding turns & < > " and ' into & < > " and ', which is what stops user-supplied text from being read as tags. Encode all goes further and also turns every non-ASCII character into a numeric entity, so é becomes é, for email templates and legacy systems that mangle UTF-8.
Decoding uses the browser's own HTML parser, so it understands all 2,000+ named entities in the HTML5 specification, from © and é to → and …, plus any numeric reference: decimal such as € or hexadecimal such as €, both of which produce the euro sign. The result is exactly what a browser would render.
A named entity the decoder does not recognise is left exactly as it was rather than dropped, and tags in the input stay as plain text, so nothing is silently lost or executed.
Frequently asked questions
- Which characters does HTML encoding escape?
- The five that matter for markup safety: ampersand, less-than, greater-than, double quote, and apostrophe. In Encode mode everything else, accented letters and emoji included, is left alone, because modern pages are UTF-8 and do not need those escaped. Encode all escapes every non-ASCII character too.
- What is ?
- A non-breaking space, U+00A0. It looks like an ordinary space but prevents a line break at that point, which is why it turns up throughout content copied out of word processors and CMS editors.
- Does it decode named entities such as © or —?
- Yes, every named entity in the HTML5 specification: © produces the copyright sign and — an em dash, as do their numeric forms © and —. Any unrecognised named entity is returned unchanged.
- Is HTML encoding the same as URL encoding?
- No. HTML entities protect characters inside a document's markup, while percent-encoding such as %20 or %3A protects characters inside a URL. Text pulled out of an HTML page can need both, applied in order.