Skip to content
Devtoolry

HTML Entity Encode / Decode

Escape special characters as HTML entities or decode entities back to text.

About the HTML Entity Encode / Decode

Characters such as <, > and & have special meaning in HTML. Encoding them as entities lets you display code and user text safely; decoding turns entities back into readable characters.

Everything runs in your browser, so your input is never uploaded to a server.

How to use the HTML Entity Encode / Decode

  1. Choose Encode or Decode.
  2. Paste the text or HTML.
  3. Optionally encode all non-ASCII characters, then copy the result.

Frequently asked questions

Does encoding protect against XSS?

Encoding text before inserting it into HTML is a key part of preventing XSS, but the right escaping depends on where the text goes (HTML, attributes, URLs or scripts).

Why encode non-ASCII characters?

Only when the page or system cannot handle UTF-8. Modern pages served as UTF-8 do not need it.