HTML Entity Encoder / Decoder — Free Online Tool
Convert special characters like <, >, &, and " to their HTML entity equivalents (<, >, &, ") for safe embedding in HTML documents. Also decodes entities back to their original characters. Covers all named HTML5 entities using the 'he' library.
100% client-side. No uploads. Your data never leaves your browser.
How to use HTML Entity Encoder / Decoder
- Paste the text you want to encode or decode into the input area.
- Select 'Encode' to convert special characters to entities, or 'Decode' to reverse the process.
- Choose between minimal encoding (dangerous characters only) or full encoding (all non-ASCII).
- Copy the result from the output area.
Frequently Asked Questions
Why do I need to encode HTML entities?
To prevent XSS (cross-site scripting) attacks, any user-supplied text that appears in HTML must have characters like <, >, and & escaped to their entity form.
What is the difference between named and numeric entities?
Named entities use readable names like & while numeric entities use code points like & or &. Both are equivalent to browsers.
Does this encode every character or just the dangerous ones?
You can choose: 'Encode minimal' escapes only the 5 dangerous characters (<, >, &, ", '). 'Encode all' converts every non-ASCII character to an entity.
Related tools
Related reading
Browse all free tools · theproductguy.in