Developer tool
HTML Entity Encoder
HTML entity encoder and decoder: escape ampersands, angle brackets and quotes, or decode named and numeric entities in a text snippet, right in your browser.
Your file never leaves your device.
Runs locally in your browser
Your text is not uploaded.
Simple steps
How it works
- 01
Paste text or encoded HTML entities.
- 02
Choose Encode or Decode.
- 03
Copy the escaped or decoded result.
What encoding changes
Encoding replaces the five characters that have a special meaning in HTML: & becomes &, < becomes <, > becomes >, " becomes " and ' becomes '. Everything else, including accented letters and emoji, stays as it is, because pages saved as UTF-8 can hold them directly.
For example, 5 < 7 & "quotes" becomes 5 < 7 & "quotes", which a browser shows exactly as typed instead of reading < as the start of a tag.
What decoding understands
Decoding turns &, <, >, " and ' back into characters, along with numeric references in decimal (©) or hexadecimal (©), which both give ©. Other named entities, such as or ©, are left unchanged; use their numeric form if you need them decoded.
If you see &lt; where you expect <, the text was encoded twice. Decode it twice to get back to <.
When encoding is not enough
Encoding these five characters makes text safe inside ordinary HTML content and inside quoted attribute values. Other places need other rules: JavaScript strings, URLs (use URL encoding), CSS and unquoted attributes. For HTML from users that should keep some formatting, use a maintained sanitizer library instead of escaping by hand.
Good to know
Frequently asked questions
Which characters are escaped?
Encoding covers ampersand, angle brackets, quotation marks, and apostrophes.
Are numeric entities decoded?
Yes. Decimal and hexadecimal numeric character references are supported.
Does encoding make HTML safe in every context?
No. Different contexts require different escaping; this tool is for ordinary HTML text content.
Is text sent to a server?
No. Entity conversion runs in your browser.
Can it sanitize HTML?
No. It encodes or decodes entities but is not an HTML sanitizer.