HTML Entity Encoder / Decoder

Show code samples on a web page, put text into HTML attributes safely, or read text full of & and ' entities.

Runs entirely in your browser. Your input and files are not uploaded to any server.

How to use

  1. Paste text or HTML.
  2. Choose Encode or Decode.
  3. For encoding, optionally convert every non-ASCII character to a numeric entity.
  4. Copy the result.

Examples

Code sample

<div class="x"> → &lt;div class=&quot;x&quot;&gt;

Decode

Tom &amp; Jerry&#39;s → Tom & Jerry’s

Privacy

Runs entirely in your browser. Your input and files are not uploaded to any server. See the privacy policy for what is stored in your browser (favorites and history only). Privacy policy

Check it yourself: open your browser’s developer tools, select the Network tab and use the tool. Your file never appears in an upload request. Once this page is saved for offline use, you can also disconnect from the internet and keep working. Ads and anonymous visit statistics, when enabled, make their own requests, but they never receive your files or text.

Frequently asked questions

Is escaping enough to prevent XSS?

Escaping text before inserting it into HTML element content or quoted attributes prevents it from being interpreted as markup. It is not enough for JavaScript, CSS or URL contexts, which need their own encoding.

Does decoding run the HTML?

No. Decoding uses an inert parser and returns plain text.

URL Encoder / DecoderPercent-encode text for URLs and query strings, decode encoded URLs, and break a full URL into its parts and query parameters.
SVG Preview & OptimizerPreview SVG files safely and shrink them by removing comments, editor metadata and whitespace, with optional number rounding.
Color Picker & ConverterPick a colour, convert between HEX, RGB and HSL, sample colours from an image or your screen, and check contrast against white and black text.

Search tools