HTML Entity Encoder & Decoder
Encode special characters to HTML entities and decode them back. Convert < > & " and all named entities instantly in your browser.
What is HTML Entity Encoder & Decoder?
HTML entities are text representations of characters that have special meaning in HTML or cannot be typed directly. The characters <, >, &, " and ' must be escaped as <, >, &, " and ' respectively when used as literal content — otherwise the browser interprets them as HTML syntax. This tool handles the encoding and decoding of all standard named entities and numeric character references.
HTML entity encoding is necessary when displaying code examples in web pages, embedding user-generated content safely, storing HTML-containing strings in JSON or XML, and preventing XSS vulnerabilities by ensuring special characters aren't interpreted as markup. It's also useful in reverse — decoding entities to read the actual content of heavily encoded strings from APIs or scraping output.
All processing happens locally in your browser. Paste your text, choose encode or decode, and the result updates instantly. The tool handles both named entities (&amp;) and numeric references (&) in both directions.
How to use
Frequently asked questions
At minimum: & → &, < → <, > → >, " → ", ' → '. Extended mode also encodes accented characters, symbols, and non-ASCII characters.
& is a named entity. & is the decimal numeric equivalent. Both represent the same character. Named entities are more readable; numeric references work for any Unicode character.
Yes. All encoding and decoding runs locally in your browser. Nothing is sent to any server.
Yes. Encoding user input before inserting it into HTML prevents script injection. Always encode on the server too — client-side encoding alone is not sufficient security.

