Skip to content

HTML Escape

Escapes or unescapes an HTML string, replacing characters that could be wrongfully interpreted as markup with their HTML entities.

Loading tool...

HTML escaping explained

Why escape HTML?

In HTML <, > and & have special meaning. When they appear in content, they must be replaced by character references, otherwise the browser interprets them as markup. Forgetting to escape is the root cause of XSS vulnerabilities.

Rules applied

Character Escaped as Why
& &amp; Starts every character reference
< &lt; Opens a tag
> &gt; Closes a tag
" &quot; Delimits attribute values
' &#39; Delimits attribute values

Unescaping

Understands named (&nbsp;), decimal (&#160;) and hexadecimal (&#xA0;) character references.

---