WebTool

HTML Entity Encoder / Decoder

Free online HTML entity encoder and decoder: named, decimal and hex forms, both ways — show code safely, fight XSS.

Privacy: all processing happens locally in your browser. Your input never leaves your device.

What is HTML Entity Encoder / Decoder?

Printing < > & " directly in HTML gets parsed as tags or breaks the page — displaying code snippets correctly and preventing XSS injection both require escaping to HTML entities first. This tool converts named entities (&lt;), decimal (&#60;) and hexadecimal (&#x3C;) forms in both directions.

How to Use

  1. Paste text with special characters or an entity string
  2. Choose escape or unescape
  3. Copy the result

FAQ

Which characters must be escaped?
At minimum < and & in HTML body text, plus quotes inside attribute values. This tool escapes the five characters & < > " ' by default.
Does escaping fully prevent XSS?
HTML entity escaping only covers body/attribute contexts; URL parameters and JavaScript contexts need their own encoding strategies — there is no one-size-fits-all.

Related Tools

Last updated 2026-09-04