HTML Entity Encoder
Free online HTML entity encoder/decoder tool
About HTML Entity Encode/Decode
Convert the five HTML-significant characters to and from their named entity references. Encoding escapes & < > " ' so that arbitrary text can be safely embedded inside HTML without being interpreted as markup. Decoding reverses the conversion, recognizing both the named forms and the numeric ' / ' variants.
How to Use
1. Toggle the Encode or Decode mode tab.\n2. In Encode mode, enter plain text or HTML to escape; in Decode mode, enter a string containing HTML entities.\n3. Click the Encode / Decode button.\n4. Copy the result with the Copy button in the output card.
Entity Mapping
Five characters are mapped to their named entities on encode: & → &, < → <, > → >, " → ", ' → '. The decoder matches the pattern &(?:amp|lt|gt|quot|#39|#x27);, so it recognizes the apostrophe in either its decimal form (') or hex form (') in addition to the four named entities. All other characters pass through unchanged in both directions.
▶Why are only five characters escaped?
▶Why is the apostrophe escaped as ' instead of '?
▶Will this protect me from XSS?
▶Does it decode arbitrary numeric entities like ’?
If this tool has been helpful to you, consider buying me a coffee.
Buy me a coffee