HTML Encode
Escape HTML special characters for safe display.
Escape HTML entities for safe output. Free, offline, runs in your browser. Read more Show less
What is HTML encoding?
HTML encoding replaces characters that have special meaning in HTML with entities: & becomes &, < becomes <, and so on. This is used when you need to display HTML as text rather than render it.
How to encode
Type or paste content. The tool escapes the five characters that matter in HTML text: &, <, >, ", '.
FAQ
Is this enough to prevent XSS?
Only when applied to text content. Attribute values need quotes, and JavaScript contexts need their own escaping. Use a real sanitizer for untrusted HTML.
Why escape the quote characters?
Because the same text may be placed inside an attribute value (in single or double quotes). Escaping both prevents breakouts.
Loads a test value into the form