Encode reserved HTML characters so they display as text instead of markup.

Free HTML Entity Encoder and Decoder

This browser-based tool converts reserved HTML characters such as ampersands, angle brackets, and quotes into entities, or turns named and numeric entities back into readable text. Choose named, decimal, or hexadecimal output and decide whether to escape only HTML special characters or all non-ASCII characters. Everything runs locally in your browser.

How to Encode or Decode HTML Entities

  1. Choose Encode or Decode.
  2. For encoding, select an entity style and whether to include non-ASCII characters.
  3. Paste text or HTML into the input box. The result updates as you type.
  4. Use Swap to reverse the workflow or Copy to put the result on your clipboard.

Security note: HTML entity encoding helps display text safely in a specific HTML context, but this converter is not an HTML sanitizer and does not replace context-aware output escaping or a trusted security library.

Frequently Asked Questions

What is an HTML entity?

An HTML entity is a character reference such as &, <, <, or <. Browsers render the reference as its corresponding character.

Which encoding style should I use?

Named entities are easiest to read for common HTML characters. Decimal and hexadecimal numeric entities can represent any Unicode code point and are useful when a numeric format is required.

Does decoding execute the HTML?

No. The decoded result is written into a plain text field. This tool does not insert the result into the page as active markup.

Is entity encoding the same as sanitizing HTML?

No. Correct escaping depends on where data is inserted, such as HTML text, attributes, URLs, CSS, or JavaScript. Use established security libraries for untrusted content.