HTML Encoder / Decoder
Encode and decode HTML entities.
InputPlain text
42 charsOutputHTML entities
ReadyThe output will appear here.Status
HTML entities processed locally.
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.
Decoding handles the named entities amp, lt, gt, quot, apos, and nbsp, plus any numeric reference: decimal such as € or hexadecimal such as €, both of which produce the euro sign.
A named entity the decoder does not recognise is left exactly as it was rather than dropped, so nothing is silently lost from your input.
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. Everything else, accented letters and emoji included, is left alone, because modern pages are UTF-8 and do not need those escaped.
- 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 —?
- Not by name. The decoder recognises amp, lt, gt, quot, apos, and nbsp. Their numeric forms do work: © produces the copyright sign and — produces an em dash. 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.