HTML Entity Encoder / Decoder

Escape HTML special characters into entities for safe embedding in HTML, or unescape entities back to readable text. Paste on the left, result appears on the right.


Characters that get encoded

FAQ

When should I encode HTML entities?

Whenever user-generated text is inserted into HTML to prevent XSS attacks. Always encode before rendering untrusted content in a page.

What is the difference between encoding and escaping?

They refer to the same process here — converting characters to their HTML entity equivalents so the browser renders them as text rather than HTML markup.

Related: URL Encoder / Decoder · Base64 Encoder / Decoder · All Tools