HTML Entity Encoder/Decoder
Switch between Encode and Decode, then type or paste your text — the result updates as you type.
What this tool does
This tool converts special characters like &, <, >,
", and ' into their HTML entity equivalents, or decodes HTML entities —
named ones like & and numeric ones like ' — back into the
original characters. The result updates live as you type, and everything runs locally in your browser.
Example use case
Encode text before embedding it inside an HTML attribute or a script that generates markup, so characters
like < and & don't get misread as the start of a tag or entity. Decode
entities when you've copied text out of a web page's source or an RSS/XML feed and it still contains raw
entity codes instead of readable characters.
Why this matters for security
Encoding user-supplied text before inserting it into HTML is one of the standard defenses against
cross-site scripting (XSS): if a browser renders < and > as entities
instead of literal characters, injected markup can't execute as a tag.